Skip to content

Commit c45b13b

Browse files
authored
Merge pull request #1154 from moreati/test-port-keyword
tests: templated remote_user keyword with delegate_to
2 parents 825a84a + 5e816be commit c45b13b

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

tests/ansible/integration/ssh/all.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
- import_playbook: templated_by_inv.yml
66
- import_playbook: templated_by_play_keyword.yml
77
- import_playbook: templated_by_play_taskvar.yml
8+
- import_playbook: templated_by_task_keyword.yml
89
- import_playbook: variables.yml
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
- name: integration/ssh/templated_by_task_keyword.yml
2+
hosts: tt_targets_bare
3+
gather_facts: false
4+
# FIXME Resetting the connection shouldn't require credentials
5+
# https://github.com/mitogen-hq/mitogen/issues/1132
6+
remote_user: "{{ 'mitogen__has_sudo_nopw' | trim }}"
7+
vars:
8+
ansible_password: has_sudo_nopw_password
9+
ansible_port: "{{ hostvars[groups['test-targets'][0]].ansible_port | default(22) }}"
10+
tasks:
11+
- name: Reset connection to target that will be delegate_to
12+
meta: reset_connection
13+
14+
- name: Test connection template by task keywords, with delegate_to
15+
hosts: test-targets[0]
16+
gather_facts: false
17+
tasks:
18+
- name: Templated by task keywords, with delegate_to
19+
delegate_to: "{{ groups.tt_targets_bare[0] }}"
20+
remote_user: "{{ 'mitogen__has_sudo_nopw' | trim }}"
21+
vars:
22+
ansible_password: has_sudo_nopw_password
23+
ansible_port: "{{ hostvars[groups['test-targets'][0]].ansible_port | default(22) }}"
24+
ping:

0 commit comments

Comments
 (0)