On 19.12.2017 00:53, Yogi Raghunathan wrote:
$ more roles/router/tasks/main.yml
---
  - name: generate configuration files
    template: src=router.j2
dest=/home/cisco/ansible/cfgs/{{item.hostname}}.txt
    with_items: " {{ routers }}"


$ more roles/router/vars/mail.yml
---
 routers:
  - { hostname: router-rtr1 }
  - { hostname: router-rtr2 }
  - { hostname: router-rtr3 }
  - { hostname: router-rtr4 }
  - { hostname: router-rtr5 }
  - { hostname: router-rtr6 }

The filename must be main.yml, not mail.yml that you have.


--
Kai Stian Olstad

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2e2c187ac9be72238e1b310f879ecb85%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to