(I created a SO question about this but maybe it would be better to ask here -
I am creating a task file in an Ansible role using the best practice directory layout e.g.
myscripts/roles
myscripts/roles/the_role
myscripts/roles/the_role/tasks
myscripts/roles/the_role/tasks/main.yml
In main.yml, I need to call a number of Java tasks so I have to specify the classpath each time e.g.
- name: java | Do something with Bar Java class
action: command java -cp A.jar:B.jar:C.jar com.example.Bar myargs
- name: java | Do something with Foo Java class
action: command java -cp A.jar:B.jar:C.jar com.example.Foo myOtherargs
so I would to use a variable to replace A.jar:B.jar:C.jar
I have been looking at the documentation and this blog post. It seems possible to make a variable that is associated with a host or a group of hosts. However this variable should be associated with a task - how do I do that? You can do it in a Playbook but I can't get it to work because I have split the Playbook into roles?
--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/642dd7bb-aae8-45ae-b237-5154e497117c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
(I created a SO question about this but maybe it would be better to ask here -
In main.yml, I need to call a number of Java tasks so I have to specify the classpath each time e.g.
- name: java | Do something with Bar Java class action: command java -cp A.jar:B.jar:C.jar com.example.Bar myargs - name: java | Do something with Foo Java class action: command java -cp A.jar:B.jar:C.jar com.example.Foo myOtherargsso I would to use a variable to replace A.jar:B.jar:C.jar