I'm stuck.  I'm sure this can all be done a better way, but right now, I'm just 
not seeing it. Can anyone offer suggestions of what else to try here?

Originally I started with one operating system, so it writing up a ansible 
playbook for the core OS configuration was simple and I ended up with a lot of 
stanzas like this:
- hosts: all:!tftp-server
  sudo: true
  tasks:
    - name: Ensure tftpd server removed
      yum: name=tftp-server state=absent

- hosts: tftp-servers
  sudo: true
  roles:
    - tftp-server

And I did this for *EVERY SERVICE* (xinetd, vsftpd, httpd, etc....) on my 
hosts. In short, if it didn't have to be on, it had to be explicitly disabled. 
[If there's a better form for these types of patterns, PLEASE let me know - 
it's so verbose and ugly, especially duplicated for every service I have on my 
boxes.]

Now, I'm adding a second OS to my playbooks.  So I created a second parallel 
playbook with similar code customized for the new OS.  But now, my problem is 
that when I'm setting up a new box, how do I have Ansible determine which 
playbook to run? My head is telling me what I want to do is this: create an 
Ansible playbook 'os_core.yml' which can determine the distro/version of the OS 
on the target box then execute the correct OS-specific playbook for that 
distro/version.  But how do I do that?  I can't do include playbook with 
variables in the path and I can't move all this to roles as I need to be able 
to differentiate plays based upon host groups.  I REALLY do not want to create 
a giant single playbook which has rules for host groups based upon things like 
'rhel5-tftp-server' vs 'centos6-tftp-server'.  That just doesn't scale.

I'm open to any and all suggestions here.

Thx
Chris.

-- 
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/BFD6B7398AEB474A9A28B39B9B5D00CB5889F013%40SRAexMBX05.sra.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to