I am trying to figure out the structure for how I am going to use Ansible 
and am having some design issues.

I would like to have multiple playbooks in my roles, each with a subset of 
tasks I need to be done. E.g. - a playbook for System Updates, a playbook 
for deploying our app, a playbook for building a system.

Right now, I have playbooks in place with conditional includes in each 
roles main.yml file. 

In my books/ directory I have my playbook for each role, and here is an 
example of the whole series of playbooks:

*// books/dev.yml*
---
- hosts: dev
  serial: 1
  roles:
   - common-dev

*// roles/common-dev/tasks/main.yml*
---
- include: build.yml
  when: pbook == "build"

- include: update.yml
  when: pbook == "update"

*// roles/common-dev/tasks/update.yml*
---
- name: "Update Kernel"
  yum: name=kernel* state=latest
  register: kernup
  sudo: yes

- name: "Update glibc"
  yum: name=glibc* state=latest
  register: glibcup
  sudo: yes

- name: "Update everything else"
  yum: name=* state=latest
  sudo: yes

- name: "Rebooting Server"
  command: /sbin/reboot
  when: kernup|changed or glibcup|changed
  sudo: yes

So, when I run ansible-playbook, I include --extra-vars="pbook=update", for 
example. It works great, but I get 'skipping' for every task out of the 
build.yml playbook. I would really like to suppress this, if at all 
possible. I know what the tasks are not running, but I am afraid of causing 
confusion as I hand off the actual running of the playbooks to other folks. 
Is there some better way to be handling this? I really don't want to have 
to build a role structure out for every grouping of tasks I want to do on a 
system to avoid confusion but keep it as simple as possible for the other 
folks running my books (e.g. just passing an extra-var rather than running 
an entirely different playbook with entirely different roles for each group 
of tasks).

Any thoughts or advice would be great on how to either suppress the 
messages or restructure it to accomplish my goal but still be somewhat 
intuitive without me having to create a new role for every set of tasks I 
want to do (dev-update, dev-build, etc)

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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/adef651b-4f1e-4c4c-b111-35a520954767%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to