ansible: use template-expanded delegate_to hostname in one more location.
parent
3b012e5bce
commit
9792b8b54f
@ -0,0 +1,4 @@
|
||||
---
|
||||
|
||||
ansible_connection: setns
|
||||
mitogen_kind: lxc
|
@ -0,0 +1,12 @@
|
||||
# Connection Delegation issue #340 reproduction.
|
||||
# Path to jails is SSH to H -> mitogen_sudo to root -> jail to J
|
||||
|
||||
[issue340]
|
||||
# 'target' plays the role of the normal host machine H.
|
||||
# 'mitogen__sudo1' plays the role of root@H via mitogen_sudo.
|
||||
# 'mitogen__user1' plays the role of root@J via mitogen__user1.
|
||||
# 'mitogen__user2' plays the role of E, the delgate_to target for certs.
|
||||
|
||||
i340-root ansible_user=mitogen__sudo1 ansible_connection=mitogen_sudo mitogen_via=target
|
||||
i340-jail ansible_user=mitogen__user1 ansible_connection=mitogen_sudo mitogen_via=i340-root
|
||||
i340-certs ansible_user=mitogen__user2 ansible_connection=mitogen_sudo mitogen_via=target
|
@ -0,0 +1,9 @@
|
||||
# integration/delegation/delegate_to_container.yml
|
||||
|
||||
# Patterned after openstack-ansible/all_containers.yml
|
||||
osa-host-machine ansible_host=172.29.236.100
|
||||
|
||||
[osa-all-containers]
|
||||
osa-container-1 container_tech=lxc
|
||||
osa-container-2 container_tech=lxc
|
||||
osa-container-3 container_tech=lxc
|
@ -1,2 +1,4 @@
|
||||
- import_playbook: delegate_to_template.yml
|
||||
- import_playbook: osa_container_standalone.yml
|
||||
- import_playbook: osa_delegate_to_self.yml
|
||||
- import_playbook: stack_construction.yml
|
||||
|
@ -0,0 +1,29 @@
|
||||
# Verify one OSA-style container has the correct config.
|
||||
|
||||
- name: integration/delegation/container_standalone.yml
|
||||
hosts: dtc-container-1
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- meta: end_play
|
||||
when: not is_mitogen
|
||||
|
||||
- mitogen_get_stack:
|
||||
register: out
|
||||
|
||||
- debug: msg={{out}}
|
||||
- assert:
|
||||
that: |
|
||||
out.result == [
|
||||
{
|
||||
'kwargs': {
|
||||
'container': 'dtc-container-1',
|
||||
'docker_path': None,
|
||||
'kind': 'lxc',
|
||||
'lxc_info_path': None,
|
||||
'machinectl_path': None,
|
||||
'python_path': ['/usr/bin/python'],
|
||||
'username': None,
|
||||
},
|
||||
'method': 'setns',
|
||||
},
|
||||
]
|
@ -0,0 +1,31 @@
|
||||
# OSA: Verify delegating the connection back to the container succeeds.
|
||||
|
||||
- name: integration/delegation/osa_delegate_to_self.yml
|
||||
hosts: osa-container-1
|
||||
vars:
|
||||
target: osa-container-1
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- meta: end_play
|
||||
when: not is_mitogen
|
||||
|
||||
- mitogen_get_stack:
|
||||
delegate_to: "{{target}}"
|
||||
register: out
|
||||
|
||||
- assert:
|
||||
that: |
|
||||
out.result == [
|
||||
{
|
||||
'kwargs': {
|
||||
'container': 'osa-container-1',
|
||||
'docker_path': None,
|
||||
'kind': 'lxc',
|
||||
'lxc_info_path': None,
|
||||
'machinectl_path': None,
|
||||
'python_path': None,
|
||||
'username': None,
|
||||
},
|
||||
'method': 'setns',
|
||||
},
|
||||
]
|
Loading…
Reference in New Issue