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

Copy module with option "decrypt: no" causes error when file already exists #30556

Closed
SteveWunderbar opened this issue Sep 19, 2017 · 1 comment · Fixed by #31047
Closed

Copy module with option "decrypt: no" causes error when file already exists #30556

SteveWunderbar opened this issue Sep 19, 2017 · 1 comment · Fixed by #31047
Assignees
Labels
affects_2.4 This issue/PR affects Ansible v2.4 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@SteveWunderbar
Copy link

ISSUE TYPE
  • Bug Report
COMPONENT NAME

Module: Copy
Option: decrypt: no #new in version 2.4.

ANSIBLE VERSION
ansible 2.4.0.0
OS / ENVIRONMENT

N/A

SUMMARY

When copying a (on the remote host non-existing) ansible-vault encrypted file with the copy module everything works fine and the copied file is encrypted (as it should be).
When the file already exists however, an error is thrown.

STEPS TO REPRODUCE

Run the following task twice to reproduce

---
- hosts: my-hosts
  tasks:
  - name: Copy vault-encrypted file
    copy:
      src: 'vault-encrypted.file'
      dest: .
      decrypt: no

  - name: Copy vault-encrypted file
    copy:
      src: 'vault-encrypted.file'
      dest: .
      decrypt: no
EXPECTED RESULTS
TASK [Copy vault-encrypted file] **********************************************************************************
changed: [my.server.com]

TASK [Copy vault-encrypted file] **********************************************************************************
ok: [my.server.com]
ACTUAL RESULTS
TASK [Copy vault-encrypted file] **********************************************************************************
changed: [my.server.com]

TASK [Copy vault-encrypted file] **********************************************************************************
fatal: [my.server.com]: FAILED! => {"changed": false, "checksum": "e88caee4fa8e6e905552d564e3d884097d8c67eb", "failed": true, "msg": "Unsupported parameters for (file) module: decrypt Supported parameters include: attributes,backup,content,delimiter,diff_peek,directory_mode,follow,force,group,mode,original_basename,owner,path,recurse,regexp,remote_src,selevel,serole,setype,seuser,src,state,unsafe_writes,validate"}
@ansibot ansibot added affects_2.4 This issue/PR affects Ansible v2.4 bug_report 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 Sep 19, 2017
@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Sep 21, 2017
@guilim
Copy link

guilim commented Sep 28, 2017

For info, same thing if decrypt: yes is used (not specific to decrypt: no)

If specified, the decrypt param seems to be passed to the file module by copy when the destination file already exists... but file does not support decrypt

bcoca added a commit to bcoca/ansible that referenced this issue Sep 28, 2017
abadger added a commit to bcoca/ansible that referenced this issue Sep 29, 2017
abadger pushed a commit that referenced this issue Sep 30, 2017
* remove action plugin only fields from 'file' calls

fixes #30556

* Add a test for #30556
(cherry picked from commit ac9278f)
abadger pushed a commit that referenced this issue Sep 30, 2017
* remove action plugin only fields from 'file' calls

fixes #30556

* Add a test for #30556
prasadkatti pushed a commit to prasadkatti/ansible that referenced this issue Oct 1, 2017
* remove action plugin only fields from 'file' calls

fixes ansible#30556

* Add a test for ansible#30556
BondAnthony pushed a commit to BondAnthony/ansible that referenced this issue Oct 5, 2017
* remove action plugin only fields from 'file' calls

fixes ansible#30556

* Add a test for ansible#30556
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.4 This issue/PR affects Ansible v2.4 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants