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

mode parameter of copy.py not work when copy recursively #44494

Closed
ptux opened this issue Aug 22, 2018 · 7 comments
Closed

mode parameter of copy.py not work when copy recursively #44494

ptux opened this issue Aug 22, 2018 · 7 comments
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. files Files category has_pr This issue has an associated PR. module This issue/PR relates to a module. P3 Priority 3 - Approved, No Time Limitation support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@ptux
Copy link
Contributor

ptux commented Aug 22, 2018

SUMMARY

When src is a dir, files are assigned the correct mode but sub dirs are not.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

copy.py

ANSIBLE VERSION
2.6
STEPS TO REPRODUCE
    - name: copy dir on localhost to a remote host
      copy:
        remote_src: False
        src: dir_on_local
        dest: /usr/local/src/new_remote_dir_dest
        mode: u=rwx,go-wx

    - name: copy dir on a remote host
      copy:
        remote_src: True
        src: /etc/httpd
        dest: /usr/local/src/new_remote_dir_dest
        mode: u=rwX,go-rwx

EXPECTED RESULTS

All files and sub dirs are assigned the specified mode.

ACTUAL RESULTS

Files are assigned the specified mode.
But, sub dirs are NOT assigned the specified mode

@ansibot
Copy link
Contributor

ansibot commented Aug 22, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Aug 22, 2018
@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Aug 23, 2018
@ptux
Copy link
Contributor Author

ptux commented Sep 22, 2018

bot_status

@ansibot
Copy link
Contributor

ansibot commented Sep 22, 2018

Components

lib/ansible/modules/files/copy.py
support: core
maintainers: ansible

Metadata

waiting_on: maintainer
needs_info: False

click here for bot help

@ptux
Copy link
Contributor Author

ptux commented Nov 9, 2018

bot_status

@ansibot
Copy link
Contributor

ansibot commented Nov 9, 2018

Components

lib/ansible/modules/files/copy.py
support: core
maintainers: ansible ptux

Metadata

waiting_on: maintainer
needs_info: False

click here for bot help

@ansibot ansibot added the files Files category label Mar 5, 2019
@ansibot ansibot added the has_pr This issue has an associated PR. label Jul 27, 2019
@ansibot
Copy link
Contributor

ansibot commented May 16, 2020

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@bcoca bcoca added needs_verified This issue needs to be verified/reproduced by maintainer P3 Priority 3 - Approved, No Time Limitation labels Mar 12, 2021
@s-hertel
Copy link
Contributor

I don't believe this is a bug, but feel free to reopen if I've made a mistake. For recursive copies, mode applies to files but not sub directories, which should be set using the directory_mode option. Since the documentation for mode mentions using directory_mode for recursive copies, I'm going to close this as resolved.

@ansible ansible locked and limited conversation to collaborators Jul 4, 2023
@sivel sivel removed the needs_verified This issue needs to be verified/reproduced by maintainer label Jul 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. files Files category has_pr This issue has an associated PR. module This issue/PR relates to a module. P3 Priority 3 - Approved, No Time Limitation support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

6 participants