+
Skip to content

synchronize module in v2.0.0 requires in pull mode hostname in src parameter #656

Open
@poliakovs

Description

@poliakovs
SUMMARY

After upgrade to version 2.0.0 from 1.2.0
synchronize module works correctly in pull mode only if src parameter starts with 'remote_hosname:'

ISSUE TYPE
  • Bug Report
COMPONENT NAME

synchronize

ANSIBLE VERSION
ansible [core 2.18.6]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/ansible-python-3.13.5/lib/python3.13/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.13.5 (main, Jul 10 2025, 16:47:46) [GCC 12.2.0] (/opt/ansible-python-3.13.5/bin/python3.13)
  jinja version = 3.1.6
  libyaml = True
COLLECTION VERSION
# /opt/ansible-python-3.13.5/lib/python3.13/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 10.7.1
CONFIGURATION
CACHE_PLUGIN(/etc/ansible/ansible.cfg) = redis
CACHE_PLUGIN_CONNECTION(/etc/ansible/ansible.cfg) = localhost:6379:3
CACHE_PLUGIN_PREFIX(/etc/ansible/ansible.cfg) = ansible_facts
CACHE_PLUGIN_TIMEOUT(/etc/ansible/ansible.cfg) = 1200
CALLBACKS_ENABLED(/etc/ansible/ansible.cfg) = ['mapp.mta_collection.totalplaybook_callback']
CONFIG_FILE() = /etc/ansible/ansible.cfg
DEFAULT_FILTER_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/etc/ansible/plugins/filter']
DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 50
DEFAULT_HASH_BEHAVIOUR(/etc/ansible/ansible.cfg) = merge
DEFAULT_HOST_LIST(/etc/ansible/ansible.cfg) = ['/etc/ansible/inventory-new.py']
DEFAULT_INTERNAL_POLL_INTERVAL(/etc/ansible/ansible.cfg) = 0.0001
DEFAULT_LOOKUP_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/etc/ansible/plugins/lookup']
DEFAULT_MANAGED_STR(/etc/ansible/ansible.cfg) = Ansible managed. {file} modified on %Y-%m-%d %H-%M-%S by {uid} on {host}
DEFAULT_MODULE_NAME(/etc/ansible/ansible.cfg) = shell
DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = default
DEFAULT_TIMEOUT(/etc/ansible/ansible.cfg) = 10
DEFAULT_VAULT_PASSWORD_FILE(/etc/ansible/ansible.cfg) = /etc/ansible/vault_pass.txt
DEPRECATION_WARNINGS(/etc/ansible/ansible.cfg) = False
DISPLAY_SKIPPED_HOSTS(/etc/ansible/ansible.cfg) = False
EDITOR(env: EDITOR) = mcedit
INTERPRETER_PYTHON(/etc/ansible/ansible.cfg) = /usr/bin/python3
INVENTORY_ENABLED(/etc/ansible/ansible.cfg) = ['yaml', 'script', 'ini', 'toml']
MAX_FILE_SIZE_FOR_DIFF(/etc/ansible/ansible.cfg) = 208896
PERSISTENT_CONNECT_RETRY_TIMEOUT(/etc/ansible/ansible.cfg) = 20
PERSISTENT_CONNECT_TIMEOUT(/etc/ansible/ansible.cfg) = 60
RETRY_FILES_ENABLED(/etc/ansible/ansible.cfg) = False
TRANSFORM_INVALID_GROUP_CHARS(/etc/ansible/ansible.cfg) = silently

GALAXY_SERVERS:
OS / ENVIRONMENT

Debian 11

STEPS TO REPRODUCE

Set "src" without "my_host:"

- hosts: my_host
  gather_facts: 
  tasks:
    - name: Download
      synchronize:
        mode: pull
        compress: no
        src: "/var/log/ecmta/file.gz"
        dest: "/root/tmp/"
EXPECTED RESULTS

File is downloaded from remote host "my_host"

ACTUAL RESULTS
fatal: [my_host]: FAILED! => {
    "changed": false,
    "cmd": "/usr/bin/rsync --delay-updates -F --archive --rsh='/usr/bin/ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' --out-format='<<CHANGED>>%i %n%L' '/var/log/ecmta/file.gz' /root/tmp/",
    "invocation": {
        "module_args": {
            "_local_rsync_password": null,
            "_local_rsync_path": "rsync",
            "_ssh_args": null,
            "_substitute_controller": false,
            "archive": true,
            "checksum": false,
            "compress": false,
            "copy_links": false,
            "delay_updates": true,
            "delete": false,
            "dest": "/root/tmp/",
            "dest_port": null,
            "dirs": false,
            "existing_only": false,
            "group": null,
            "link_dest": null,
            "links": null,
            "mode": "pull",
            "owner": null,
            "partial": false,
            "perms": null,
            "private_key": null,
            "recursive": null,
            "rsync_opts": [],
            "rsync_path": null,
            "rsync_timeout": 0,
            "set_remote_user": true,
            "src": "/var/log/ecmta/file.gz",
            "ssh_connection_multiplexing": false,
            "times": null,
            "use_ssh_args": false,
            "verify_host": false
        }
    },
    "msg": "rsync: [sender] change_dir \"/var/log/ecmta\" failed: No such file or directory (2)\nrsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1338) [sender=3.2.7]\n",
    "rc": 23
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载