All, I'm new to Ansible so forgive me if this is already answered as I was
unable to find a solution with my research.
I have an application which uses a Java properties file
(/usr/local/app/app.properties) which contains key/value pairs like so:
THRESHOLD=75
NUM_THREADS=3
REAPER_COUNT=1
The application requires some environment setup which is currently
performed by a shell script that I'm converting over to
an Ansible playbook. I would like to reference the value of these
properties in the tasks for the playbook like normal e.g.
- shell: app_setup {{ THRESHOLD }}
but can't seem to figure out a way to do so. I have tried the following to
register the value of a property like so (which works):
- shell: grep THRESHOLD /usr/local/app/app.properties | cut -d "=" -f2
register: THRESHOLD
But the above requires me to remember to use {{ THRESHOLD.stdout }} every
time which I would like to avoid as I'm sure to forget this when used over
time. I looked at the Lookups
<http://docs.ansible.com/playbooks_lookups.html>options in the
documentation but do not see a way to use it to accomplish what I would
like. Is there a way to register an Ansible variable from the value of a
straight forward key/value file?
--
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/96087981-b05d-482f-a30a-e9bbeb03715c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.