No, I'm afraid the -i flag does not make a difference.
I'm trying to avoid a shell hack and it just seems really basic that we
should have easy access to the environment variables of the target login
account.
On Tuesday, June 2, 2015 at 11:12:37 PM UTC-6, benno joy wrote:
>
> 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]
> <javascript:>> 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] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> 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/7cd0081a-0980-4072-abf2-b84d3524f78c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.