if gather_facts are run on the target server, the hash {{ ansible_env }}
should have some environment variables.
also the ansible ssh connection doesnt invoke a login shell so .bashrc
scripts wouldnt not be run . if you use sudo and set -i flag in sudo_flags
in ansible.cfg a login shell would be invoked and i think bashrc woudl be
run.

- Benno


On Wed, Jun 3, 2015 at 3:34 AM, Steve Orr <[email protected]> wrote:

> I access a target host thru a bastion server which requires a Yubikey
> password. I have setup ssh keys so I can access the target host without a
> password prompt once the authenticated socket on the bastion is cached.
> When I run setup against the target host, none of the specific environment
> variables setup via .bashrc on that target host appear.
>
> Here's a snippet of my ~/.ssh/config to show how I access the target::
> Host xx
>   Hostname xxname.example.com
> Host xxdb*
>   ProxyCommand ssh -q xx -W %h:%p
>
> The environment variables I'm after are on the xxdb02 server (via ssh
> xxdb02) under a Linux account which owns the vendor software I'm trying to
> manage. These environment variables vary by host. Rather than recreate this
> data in yml I want to pick up what's already defined in the target host
> account. To no avail I've played around with the environment key word and
> with shell commands to pickup these variables.
>
> There must be a better way. Please cure me of my cluelessness.
>
> AtDhVaAnNkCsE
>
>  --
> 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/e37984a6-7dda-4a8e-9934-e4cacee96791%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/e37984a6-7dda-4a8e-9934-e4cacee96791%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAFUV_d4Bgx6-LaqMVHg5gS8ffUTHXHcNGNCaf1V4dRdwjzu7MA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to