If I understand your question correctly, then why not just have two playbooks? We have an infrastructure.yml playbook which provisions a server for us. We also have another playbook which makes alterations to that server dependent on its role. For example, in our case when we provision a Jenkins server, I run the infrastructure.yml playbook which targets all servers (qa-machines in your case) in its host specification (remember that you can use ansible's limit <http://docs.ansible.com/ansible/playbooks_best_practices.html#top-level-playbooks-are-separated-by-role> attribute to narrow the scope of the playbook from the command line) and then I run jenkins.yml afterwards which targets just the jenkins server (jenkins-slaves in your example).
On Wednesday, 26 October 2016 16:28:45 UTC+1, [email protected] wrote: > > Hello, > How to best model the following scenario: > > I have a set of hosts in one playbook. > > [qa-machines] > HostA > HostB > HostC > > I have a subset of these hosts that should receive additional roles. > > [jenkins-slaves] > HostC > > I have a Vagrantfile that I would like to use to set up one host of each > category. > > Including first playbook from the second one does not work, because I > cannot parameterize the hosts when including a playbook. > > What I would like to achieve is, when the "setup-qa-machine" playbook is > changed, it does not require to change in the "setup-jenkins-slave" > playbook, which would be the case if I repeated the common roles. > > it feels a bit like I was not seeing the obvious right now, so any help is > appreciated. Thanks! > -- 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/2a2563c9-cc01-476a-b981-042a8e1e082a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
