Open
Description
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
Labels
No labels