I'm getting problems while trying to access variables from another host in
my Ansible template.
I'm using a SSH proxycommand configuration to access 'internal' instances
in EC2.
My inventory host file is like:
cat /etc/hosts
[test1]
test1
[test2]
test2
My SSH configuration:
Host test1
User ubuntu
IdentityFile /home/dev/.ssh/private-key
Hostname XX.XX.XX.XX
StrictHostKeyChecking no
Host test2
User ubuntu
IdentityFile /home/dev/.ssh/private-key
Hostname 10.0.1.10
ProxyCommand ssh -F /home/dev/thing/ssh_config -W %h:%p test1
StrictHostKeyChecking no
ControlMaster auto
ControlPath /home/dev/.ssh/tmp/%h_%p_%r
and my template is like:
{{ hostvars['test1'] }}
{{ hostvars['test2'] }}
The first line in the previous template gives me all host variables, but
the second, only shows:
{'inventory_hostname': 'test2', 'group_names': ['test2'],
'inventory_hostname_short': 'test2'}
How do i fix it?
--
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/06aec499-62fa-4385-b46f-2aac5e70332e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.