Hi, 

I have been breaking my head on the following for the past few days now and 
I can't come up with a clean solution that will keep my roles portable.
Effectively, what I want to do is have two role (webserver / monitoring), 
depending on whether the first one ran the second one should install an 
additional script.

The cleanest solution I came up with so far is to use the new magic '{{ 
role_names }}' to determine whether a role was applied within that play, 
however
I have another separate playbook that only applies the 'second' role 
(monitoring), for the sake of easily updating all monitoring agents 
landscape wide, this play obviously doesn't include 'webserver' and hence 
the logic breaks.

Using the 'groups' mechanism doesn't work very well either, since when a 
group is undefined, the entire playbook fails. Working with many 
inventories that have different groups defined, this breaks the portability 
of my roles.

The only thing I can think of that would work but which is dead ugly, is 
defining a variable on group level that says 'webserver_installed: true' or 
similar, and have the agent role install the scripts when defined.

Is there any other approach that anyone can think of?

Thanks a lot,
Nico

-- 
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/9692be40-6bea-45c3-b3ce-c3460c3ef69c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to