Hi friends in Ansible
I would like to loop over a list roles. The following failing sample should
explain what I try to acchieve:
- hosts: all
become: yes
become_method: sudo
remote_user: root
vars:
servers:
- server1:
name: abadoc1
port: 9000
- server2:
name: abadoc2
port: 9100
- server3:
name: abadoc3
port: 9200
tasks:
loop: "{{ servers }}"
- include_role:
name: common
- include_role:
name: dockercompose
- include_role:
name: dockerinstallrepos
- include_role:
name: logrotate
As you can see, there are a number of servers. For each one a set of roles
should executed.
How can I do that? A sample or a link to a tutorial, would be much appreciated.
Thanks a lot for your help
Robert
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/6420c4c2-881e-10ee-d73b-6d532c8a4464%40redcor.ch.