We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When delegate_to is used, the ansible_ssh* variables from the inventory are ignored even when use_ssh_args: true.
delegate_to
ansible_ssh*
use_ssh_args: true
ansible.posix.synchronize
ansible [core 2.16.3] config file = /etc/ansible/ansible.cfg configured module search path = ['~/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /opt/mambaforge/envs/ansible/lib/python3.12/site-packages/ansible ansible collection location = ~/.ansible/collections:/usr/share/ansible/collections executable location = /opt/mambaforge/envs/ansible/bin/ansible python version = 3.12.1 | packaged by conda-forge | (main, Dec 23 2023, 08:03:24) [GCC 12.3.0] (/opt/mambaforge/envs/ansible/bin/python3.12) jinja version = 3.1.3 libyaml = True
Collection Version ------------- ------- ansible.posix 1.5.4 community.general 8.3.0
COLLECTIONS_PATHS(/etc/ansible/ansible.cfg) = ['~/.ansible/collections', '/usr/share/ansible/collections'] CONFIG_FILE() = /etc/ansible/ansible.cfg DEFAULT_FILTER_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['~/.ansible/plugins/filter', '/usr/share/ansible/plugins/filter'] DEFAULT_ROLES_PATH(/etc/ansible/ansible.cfg) = ['~/.ansible/roles', '/usr/share/ansible/roles', '/etc/ansible/roles'] EDITOR(env: EDITOR) = vim GALAXY_COLLECTION_SKELETON_IGNORE(/etc/ansible/ansible.cfg) = ['^.git$', '^.*/.git_keep$', '^.*/.gitkeep$']
CentOS7, Rocky8, Rocky9
The hosts.yml
hosts.yml
all: hosts: jump: dest: src: ansible_ssh_common_args: "-J jump.host"
and the playbook
- name: Test stuff gather_facts: false hosts: src tasks: - name: Sync file to dest ansible.posix.synchronize: mode: pull src: /tmp/file dest: /tmp/file use_ssh_args: true delegate_to: dest become: true
The resulting rsync command should include -J jump.host in the --rsh option.
rsync
-J jump.host
--rsh
The ansible_ssh* variables set in hosts.yml are ignored. Consequently the play fails.
fatal: [src -> dest]: FAILED! => changed=false cmd: /bin/rsync --delay-updates -F --compress --archive --rsh='/bin/ssh -S none -i /root/.ssh/id_rsa -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no' --rsync-path='sudo -u root rsync' --out-format='<<CHANGED>>%i %n%L' root@dest:/tmp/file /tmp/file msg: |- sss_ssh_knownhostsproxy: Could not resolve hostname src kex_exchange_identification: Connection closed by remote host Connection closed by UNKNOWN port 65535 rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: unexplained error (code 255) at io.c(228) [Receiver=3.2.3] rc: 255
Possibly related:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
SUMMARY
When
delegate_to
is used, theansible_ssh*
variables from the inventory are ignored even whenuse_ssh_args: true
.ISSUE TYPE
COMPONENT NAME
ansible.posix.synchronize
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
CentOS7, Rocky8, Rocky9
STEPS TO REPRODUCE
The
hosts.yml
and the playbook
EXPECTED RESULTS
The resulting
rsync
command should include-J jump.host
in the--rsh
option.ACTUAL RESULTS
The
ansible_ssh*
variables set inhosts.yml
are ignored.Consequently the play fails.
Possibly related:
The text was updated successfully, but these errors were encountered: