As I read through the Ansible documentation (http://docs.ansible.com) I 
still a bit fuzzy on the playbook vs. module vs. role concept, and where 
different pieces of the puzzle go. Playbooks contain Ansible code, modules (
http://docs.ansible.com/ansible/developing_modules.html) seem to be Python 
and roles I'm not too sure about.

I'll give an example: I want to write a playbook to check or update the DNS 
client configuration on a RHEL 6 or 7 system. For the sake of this example 
I will say that I only want to update /etc/resolv.conf to ensure the 
servers and suffix search order are correct. I suppose I could brute force 
the configuration change by overwriting the /etc/resolv.conf, but keep 
thinking that there is a more elegant approach. I found a couple of roles (
https://github.com/jdauphant/ansible-role-dns, 
https://github.com/trumant/ansible-resolv) which kinda do what I want, but 
not quite (I don't want this topic to be about these specific roles or why 
the authors wrote what they wrote, I'm just using them as examples.), and 
I've also looked into modules (
https://github.com/ansible/ansible-modules-core).

How do I decide what logic goes where? I sense that I need a to start with 
a suitable role and then build a playbook that wraps around it, 
yes/no/maybe?

-- 
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/b47b896b-e70e-4fa5-a100-af5a0929b636%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to