Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: templated remote_user keyword with delegate_to #1154

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

moreati
Copy link
Member

@moreati moreati commented Oct 9, 2024

refs #1040

@moreati
Copy link
Member Author

moreati commented Oct 9, 2024

Templated port keyword fails, but only on the combination macOS with Ansible 20 (ansible-core 2.17). Both Mitogen+Ansible and vanilla Ansible are affected

- 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_password: has_sudo_nopw_password
  tasks:
    - meta: reset_connection
    - name: Templated variables in play keywords
      ping:
PLAY [integration/ssh/templated_by_play_keyword.yml] ***************************

TASK [meta _raw_params=reset_connection] ***************************************
Wednesday 09 October 2024  13:49:22 +0000 (0:00:01.514)       0:04:22.030 ***** 
ERROR! Invalid type for configuration option plugin_type: connection plugin: mitogen_ssh setting: port (from keyword: port): invalid literal for int() with base 10: "{{ hostvars[groups['test-targets'][0]].ansible_port | default(22) }}"
usage: ansible-playbook [-h] [--version] [-v] [--private-key PRIVATE_KEY_FILE]
                        [-u REMOTE_USER] [-c CONNECTION] [-T TIMEOUT]
PLAY [integration/ssh/templated_by_play_keyword.yml] ***************************

TASK [meta _raw_params=reset_connection] ***************************************
Wednesday 09 October 2024  13:50:11 +0000 (0:00:20.686)       0:04:39.457 ***** 
ERROR! Invalid type for configuration option plugin_type: connection plugin: ssh setting: port (from keyword: port): invalid literal for int() with base 10: "{{ hostvars[groups['test-targets'][0]].ansible_port | default(22) }}"
usage: ansible-playbook [-h] [--version] [-v] [--private-key PRIVATE_KEY_FILE]
                        [-u REMOTE_USER] [-c CONNECTION] [-T TIMEOUT]

@moreati moreati changed the title Test port keyword & connection keywords with delegate_to Test remote_user keyword with delegate_to Oct 9, 2024
@moreati moreati changed the title Test remote_user keyword with delegate_to tests: templated remote_user keyword with delegate_to Oct 9, 2024
@moreati moreati marked this pull request as ready for review October 9, 2024 15:38
@moreati moreati merged commit c45b13b into mitogen-hq:master Oct 9, 2024
48 checks passed
@moreati moreati deleted the test-port-keyword branch October 9, 2024 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant