Skip to content

Commit

Permalink
tests: Templated connection keywords with delegated_to
Browse files Browse the repository at this point in the history
  • Loading branch information
moreati committed Oct 9, 2024
1 parent 887b41f commit 7f8cf05
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/ansible/integration/ssh/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
- import_playbook: templated_by_inv.yml
- import_playbook: templated_by_play_keyword.yml
- import_playbook: templated_by_play_taskvar.yml
- import_playbook: templated_by_task_keyword.yml
- import_playbook: variables.yml
22 changes: 22 additions & 0 deletions tests/ansible/integration/ssh/templated_by_task_keyword.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
- name: integration/ssh/templated_by_task_keyword.yml
hosts: tt_targets_bare
gather_facts: false
port: "{{ hostvars[groups['test-targets'][0]].ansible_port | default(22) }}"
remote_user: "{{ 'mitogen__has_sudo_nopw' | trim }}"
vars:
ansible_password: has_sudo_nopw_password
tasks:
- name: Reset connection to target that will be delegate_to
meta: reset_connection

- name: Test connection template by task keywords, with delegate_to
hosts: test-targets[0]
gather_facts: false
tasks:
- name: Templated by task keywords, with delegate_to
delegate_to: "{{ tt_targets_bare[0] }}"
port: "{{ hostvars[groups['test-targets'][0]].ansible_port | default(22) }}"
remote_user: "{{ 'mitogen__has_sudo_nopw' | trim }}"
vars:
ansible_password: has_sudo_nopw_password
ping:

0 comments on commit 7f8cf05

Please sign in to comment.