AnsweredAssumed Answered

Use a list of hosts in an Ansible Playbook

Question asked by Jason Smith Employee on Sep 29, 2017
Latest reply on Oct 2, 2017 by Jason Smith

I need to add a lot of hosts to an R80.10 Mgmt and I don't want to have to write the add-host command over and over again. I've created a list of hosts with the parameters name, ip-address, and color in it. 

 

Example:

{name: host1, ip-address: 1.1.1.1, color: yellow}
{name: host2, ip-address: 1.1.1.2, color: yellow}
{name: host3, ip-address: 1.1.1.3, color: yellow}

How can I use this in an ansible playbook?

Outcomes