I like Ubuntu but I want to switch to Fedora. I'm trying to port my 
playbooks that I wrote to work on Ubuntu and port them to Fedora. Here is 
the most I've been able to factor my roles down to:

---
- name: file system related packages (Ubuntu)...
  apt: name={{item}}
  when: ansible_distribution == "Ubuntu"
  with_items:
    - sshfs
    - cifs-utils
    - samba
    - samba-common

- name: file system related packaged (Fedora)...
  yum: name={{item}}
  when: ansible_distribution == "Fedora"
  with_items: 
    - sshfs
    - cifs-utils
    - samba
    - samba-common

I'm rolling my eyes at the amount of boilerplate copy and paste in here. Is 
there a better recommended practice or trick that you recommend? Should I 
be creating separate roles and knitting the roles together in different 
playbooks by platform?

regards, Andrew

-- 
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/505242f0-aadb-432f-862e-3867881bc3c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to