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

#361 breaks synchronize when paths contain : and @ #591

Open
flowerysong opened this issue Nov 11, 2024 · 0 comments
Open

#361 breaks synchronize when paths contain : and @ #591

flowerysong opened this issue Nov 11, 2024 · 0 comments
Labels
synchronize Issue and PR for synchronize module

Comments

@flowerysong
Copy link
Contributor

SUMMARY

#361 attempted to broaden the format of acceptable paths for the synchronize module beyond what was previously working, but it did so in a very broken way. : and @ are valid characters for a filename to contain.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

synchronize

ANSIBLE VERSION
ansible [core 2.17.4]
  config file = /home/ec2-user/ansible-aws/ansible/ansible.cfg
  configured module search path = ['/home/ec2-user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ec2-user/ansible-aws/.venv/lib/python3.12/site-packages/ansible
  ansible collection location = /home/ec2-user/ansible-aws/ansible/collections
  executable location = /home/ec2-user/ansible-aws/.venv/bin/ansible
  python version = 3.12.1 (main, Feb 19 2024, 00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1-3)] (/home/ec2-user/ansible-aws/.venv/bin/python)
  jinja version = 3.1.4
  libyaml = True
COLLECTION VERSION
Collection    Version
------------- -------
ansible.posix 1.6.2
CONFIGURATION
ANSIBLE_PIPELINING(/home/ec2-user/ansible-aws/ansible/ansible.cfg) = True
COLLECTIONS_PATHS(env: ANSIBLE_COLLECTIONS_PATH) = ['/home/ec2-user/ansible-aws/ansible/collections']
CONFIG_FILE() = /home/ec2-user/ansible-aws/ansible/ansible.cfg
DEFAULT_ACTION_PLUGIN_PATH(env: ANSIBLE_ACTION_PLUGINS) = ['/home/ec2-user/ansible-aws/.venv/lib/python3.9/site-packages/ara/plugins/action', '/home/ec2-user/ansible-aws/.venv/lib/python3.12/site-packages/ara/plugins/action']
DEFAULT_BECOME(/home/ec2-user/ansible-aws/ansible/ansible.cfg) = True
DEFAULT_BECOME_METHOD(/home/ec2-user/ansible-aws/ansible/ansible.cfg) = sudo
DEFAULT_CALLBACK_PLUGIN_PATH(env: ANSIBLE_CALLBACK_PLUGINS) = ['/home/ec2-user/ansible-aws/.venv/lib/python3.9/site-packages/ara/plugins/callback', '/home/ec2-user/ansible-aws/.venv/lib/python3.12/site-packages/ara/plugins/callback']
DEFAULT_GATHERING(/home/ec2-user/ansible-aws/ansible/ansible.cfg) = explicit
DEFAULT_HOST_LIST(env: ANSIBLE_INVENTORY) = ['/home/ec2-user/ansible-aws/ansible/inventory_nonprod']
DEFAULT_JINJA2_NATIVE(/home/ec2-user/ansible-aws/ansible/ansible.cfg) = True
DEFAULT_LOAD_CALLBACK_PLUGINS(/home/ec2-user/ansible-aws/ansible/ansible.cfg) = True
DEFAULT_LOOKUP_PLUGIN_PATH(env: ANSIBLE_LOOKUP_PLUGINS) = ['/home/ec2-user/ansible-aws/.venv/lib/python3.9/site-packages/ara/plugins/lookup', '/home/ec2-user/ansible-aws/.venv/lib/python3.12/site-packages/ara/plugins/lookup']
DEFAULT_REMOTE_USER(/home/ec2-user/ansible-aws/ansible/ansible.cfg) = ec2-user
DEVEL_WARNING(env: ANSIBLE_DEVEL_WARNING) = False
EDITOR(env: EDITOR) = vim
HOST_KEY_CHECKING(/home/ec2-user/ansible-aws/ansible/ansible.cfg) = False
INJECT_FACTS_AS_VARS(/home/ec2-user/ansible-aws/ansible/ansible.cfg) = False
INTERPRETER_PYTHON(/home/ec2-user/ansible-aws/ansible/ansible.cfg) = /usr/local/venv/system/bin/python3
INVENTORY_ENABLED(/home/ec2-user/ansible-aws/ansible/ansible.cfg) = ['auto', 'yaml', 'ini']
RETRY_FILES_ENABLED(/home/ec2-user/ansible-aws/ansible/ansible.cfg) = False
OS / ENVIRONMENT
STEPS TO REPRODUCE
- hosts: Class_syslog
  vars:
    testfiles:
      - g:b
      - g:@b
  tasks:
    - ansible.builtin.file:
        dest: /var/tmp/{{ item }}
        state: touch
      loop: "{{ testfiles }}"

    - ansible.posix.synchronize:
        mode: pull
        src: /var/tmp/{{ item }}
        dest: /var/tmp/testfile
      loop: "{{ testfiles }}"
EXPECTED RESULTS

Synchronization of the valid file path that I provided, as was done in ansible.posix 1.5.4.

changed: [crimson-lengspider.syslog.x.mail.umich.edu] => (item=g:b) => 
    ansible_loop_var: item
    changed: true
    cmd: /bin/rsync --delay-updates -F --compress --archive --rsh='/bin/ssh -S none -o
        StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' --rsync-path='sudo -u
        root rsync' --out-format='<<CHANGED>>%i %n%L' [email protected]:/var/tmp/g:b
        /var/tmp/testfile
    item: g:b
    msg: |-
        >f+++++++++ g:b
    rc: 0
    stdout_lines:
    - '>f+++++++++ g:b'
changed: [crimson-lengspider.syslog.x.mail.umich.edu] => (item=g:@b) => 
    ansible_loop_var: item
    changed: true
    cmd: /bin/rsync --delay-updates -F --compress --archive --rsh='/bin/ssh -S none -o
        StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' --rsync-path='sudo -u
        root rsync' --out-format='<<CHANGED>>%i %n%L' [email protected]:/var/tmp/g:@b
        /var/tmp/testfile
    item: g:@b
    msg: |-
        >f+++++++++ g:@b
    rc: 0
    stdout_lines:
    - '>f+++++++++ g:@b'
ACTUAL RESULTS
TASK [ansible.posix.synchronize] ***********************************************
failed: [crimson-lengspider.syslog.x.mail.umich.edu] (item=g:b) => 
    ansible_loop_var: item
    changed: false
    cmd: /bin/rsync --delay-updates -F --compress --archive --rsh='/bin/ssh -S none -o
        StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' --rsync-path='sudo -u
        root rsync' --out-format='<<CHANGED>>%i %n%L' ec2-user@/var/tmp/g:b /var/tmp/testfile
    item: g:b
    msg: |-
        rsync: [sender] change_dir "/home/ec2-user/ec2-user@/var/tmp" failed: No such file or directory (2)
        rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1330) [sender=3.2.3]
    rc: 23
failed: [crimson-lengspider.syslog.x.mail.umich.edu] (item=g:@b) => 
    ansible_loop_var: item
    changed: false
    cmd: /bin/rsync --delay-updates -F --compress --archive --rsh='/bin/ssh -S none -o
        StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' --rsync-path='sudo -u
        root rsync' --out-format='<<CHANGED>>%i %n%L' /var/tmp/g:@b /var/tmp/testfile
    item: g:@b
    msg: |-
        rsync: [sender] link_stat "/var/tmp/g:@b" failed: No such file or directory (2)
        rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1330) [sender=3.2.3]
    rc: 23
@flowerysong flowerysong changed the title #361 breaks synchronize #361 breaks synchronize when paths contain : and @ Nov 11, 2024
@saito-hideki saito-hideki added the synchronize Issue and PR for synchronize module label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
synchronize Issue and PR for synchronize module
Projects
None yet
Development

No branches or pull requests

2 participants