Skip to content

Commit

Permalink
tests: Test templated connection port provided by Ansible keyword
Browse files Browse the repository at this point in the history
Missed this in mitogen-hq#1145

Refs mitogen-hq#978
  • Loading branch information
moreati committed Nov 7, 2024
1 parent 5ae5bb9 commit 69017d8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ In progress (unreleased)
(e.g. ``ansible_host_key_checking``, ``ansible_ssh_host_key_checking``).
* :gh:issue:`1083` :mod:`ansible_mitogen`: Templated host address
(e.g. ``ansible_host``, ``ansible_ssh_host``)
* :gh:issue:`978` Test templated port provided by Ansible play or task keyword


v0.3.16 (2024-11-05)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
- name: integration/ssh/templated_by_play_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_host: "{{ hostvars[groups['test-targets'][0]].host | default('localhost') }}"
ansible_password: has_sudo_nopw_password
ansible_port: "{{ hostvars[groups['test-targets'][0]].ansible_port | default(22) }}"
tasks:
- meta: reset_connection
- name: Templated variables in play keywords
Expand Down
4 changes: 2 additions & 2 deletions tests/ansible/integration/ssh/templated_by_task_keyword.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
gather_facts: false
# FIXME Resetting the connection shouldn't require credentials
# https://github.com/mitogen-hq/mitogen/issues/1132
port: "{{ hostvars[groups['test-targets'][0]].ansible_port | default(22) }}"
remote_user: "{{ 'mitogen__has_sudo_nopw' | trim }}"
vars:
ansible_host: "{{ hostvars[groups['test-targets'][0]].host | default('localhost') }}"
ansible_password: has_sudo_nopw_password
ansible_port: "{{ hostvars[groups['test-targets'][0]].ansible_port | default(22) }}"
tasks:
- name: Reset connection to target that will be delegate_to
meta: reset_connection
Expand All @@ -18,9 +18,9 @@
tasks:
- name: Templated by task keywords, with delegate_to
delegate_to: "{{ groups.tt_targets_bare[0] }}"
port: "{{ hostvars[groups['test-targets'][0]].ansible_port | default(22) }}"
remote_user: "{{ 'mitogen__has_sudo_nopw' | trim }}"
vars:
ansible_host: "{{ hostvars[groups['test-targets'][0]].host | default('localhost') }}"
ansible_password: has_sudo_nopw_password
ansible_port: "{{ hostvars[groups['test-targets'][0]].ansible_port | default(22) }}"
ping:

0 comments on commit 69017d8

Please sign in to comment.