+
Skip to content

Desperate need of a chdir parameter in ansible.posix.synchronize module #634

Open
@eugene-su

Description

@eugene-su
SUMMARY

Add support for a chdir parameter to the ansible.posix.synchronize module.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

ansible.posix.synchronize

ADDITIONAL INFORMATION

The synchronize module would greatly benefit from a chdir parameter, similar to what other modules provide. This would allow users to change the working directory before running rsync.

This is especially important when using the --relative (-R) flag, where the current working directory has a crucial impact on how paths are constructed and synced. Without the ability to set the working directory explicitly, using relative paths becomes error-prone or outright infeasible in more complex scenarios.

- name: Sync files from a nested directory using --relative
  ansible.posix.synchronize:
    src: roles/app/files/
    dest: remote/dir/
    mode: push
    rsync_opts:
      - "--relative"
    chdir: /home/user/project/

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浏览器服务,不要输入任何密码和下载