On Sunday, February 23, 2014 10:25:46 AM UTC-8, Mark Butler wrote: > > (I created a SO question about this but maybe it would be better to ask > here - > Probably, I don't know your Significant Other... :-D
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 > Well, it sounds like you need to set a variable and then use it in your task. group_vars are associated with groups, but there are a whole host of places that you can create that particular variable. I would advise reading most of the documentation page on Variables... http://docs.ansible.com/playbooks_variables.html Where you should put that variable in your case is pretty much up to you. The variable precedence section will help you to decide where you should put it to ensure that you get the results that you want. Adam -- 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/0bc27242-3bda-4584-a7d0-e2d4a6af312d%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
