What type of OS's are you referring to ? If you are staying within the
realm of Linux's you can gather facts and then do when statement. It might
also be good to just create separate named roles for the different OS.
- name: Copy | Copy Repo
copy: src=/etc/ansible/files/repos/oracle_local_6.repo
dest=/etc/yum.repos.d/oracle_local_6.repo
when:
- ansible_facts['distribution_major_version'] == "6"
- name: Copy | Copy Repo
copy: src=/etc/ansible/files/repos/oracle_local_7.repo
dest=/etc/yum.repos.d/oracle_local_7.repo
when:
- ansible_facts['distribution_major_version'] == "7"
. You could also separate out things within the inventory file such as
[debian]
server1
server2
[centos]
server3
server4
then do individual playbooks on those groups using something like
- hosts: centos
-tasks:
blah blah blah
- hosts: debian
-tasks
blah blah blah
--
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/e90a7bc6-cf19-464b-9369-8d1ced196c06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.