Skip to content

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

@SteveWunderbar

Description

@SteveWunderbar
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"}

Metadata

Metadata

Assignees

Labels

affects_2.4This issue/PR affects Ansible v2.4bugThis issue/PR relates to a bug.moduleThis issue/PR relates to a module.support:coreThis issue/PR relates to code supported by the Ansible Engineering Team.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions