issue #340: use expanded delegate_to hostname, not template.
PlayContext.delegate_to is the unexpanded template, Ansible doesn't keep a copy of it around anywhere convenient. We either need to re-expand it or take the expanded version that was stored on the Task, which is what is done here.pull/350/head
parent
154dc2e119
commit
3d588323ff
@ -1,2 +1,2 @@
|
|||||||
|
- import_playbook: delegate_to_template.yml
|
||||||
- import_playbook: stack_construction.yml
|
- import_playbook: stack_construction.yml
|
||||||
|
|||||||
@ -0,0 +1,41 @@
|
|||||||
|
# Ensure templated delegate_to field works.
|
||||||
|
|
||||||
|
- name: integration/delegation/delegate_to_template.yml
|
||||||
|
vars:
|
||||||
|
physical_host: "cd-normal-alias"
|
||||||
|
physical_hosts: ["cd-normal-alias", "cd-normal-normal"]
|
||||||
|
hosts: test-targets
|
||||||
|
gather_facts: no
|
||||||
|
any_errors_fatal: true
|
||||||
|
tasks:
|
||||||
|
- mitogen_get_stack:
|
||||||
|
delegate_to: "{{ physical_host }}"
|
||||||
|
register: out
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that: |
|
||||||
|
out.result == [
|
||||||
|
{
|
||||||
|
'kwargs': {
|
||||||
|
'check_host_keys': 'ignore',
|
||||||
|
'connect_timeout': 10,
|
||||||
|
'hostname': 'cd-normal-alias',
|
||||||
|
'identity_file': None,
|
||||||
|
'password': None,
|
||||||
|
'port': None,
|
||||||
|
'python_path': None,
|
||||||
|
'ssh_args': [
|
||||||
|
'-o',
|
||||||
|
'ForwardAgent=yes',
|
||||||
|
'-o',
|
||||||
|
'ControlMaster=auto',
|
||||||
|
'-o',
|
||||||
|
'ControlPersist=60s',
|
||||||
|
],
|
||||||
|
'ssh_debug_level': None,
|
||||||
|
'ssh_path': 'ssh',
|
||||||
|
'username': None,
|
||||||
|
},
|
||||||
|
'method': 'ssh',
|
||||||
|
},
|
||||||
|
]
|
||||||
Loading…
Reference in New Issue