Brian,
Thanks for the response, I acknowledge all of these points and accept that
this is the situation.
In the example at point 3. the environment variable is provided to multiple
shell tasks, but in this scenario the value of the environment variable
being passed is known prior to execution.
Perhaps I should have better described my constraints, as the example of
setting the environment variable in the shell using 'export' was only to to
show I couldn't access the value outside the shell.
In my example replace the 'export ANIMAL=droppear' to a binary called
'blackbox', this 'blackbox' binary generates results in the form of setting
environment variables that I need to access, one of them named 'ANIMAL'.
ie.
---
- hosts: all
tasks:
- name: Export environment variable
shell: /usr/local/bin/blackbox
My question is still the same, is there a method to access the 'ANIMAL'
environment variable generated by the 'blackbox' binary I call using a
shell task? ie. I don't have a value I want to pass into the environment, I
wan't to extract the environment variable out of the result of a shell task
that is run and make it available to other tasks.
--
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/2c964310-e7f8-4651-b521-0141a5d38ea8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.