Invoke roles with different variables

5 views
Skip to first unread message

John Gateley

unread,
Apr 13, 2019, 12:42:11 PM4/13/19
to ansible...@googlegroups.com
Hello,

I have a role "runit_service" that creates a runit service based on variables (service_name, script etc.)

I have two roles that depend on runit_service: role_a and role_b. The intent is to create two runit_services. The tail meta file for role_a looks like:
dependencies:
- role: runit_service
vars:
service_name: role_a
script: /usr/bin/python3 /usr/local/bin/role_a
and the tail of the meta file for role_b is similar, except it has role_b in place of role_a
Finally my playbook is:
- hosts: "{{ host }}"
roles:
- role_a
- role_b
The issue is that role_b creates a service using the variables from role_a.
What is the proper way to do this?

Thank you very much

John
Reply all
Reply to author
Forward
0 new messages