How Do You Troubleshoot the Ansible Error “Unsupported parameters for (copy) module: become Supported parameters”?

Problem scenario
You are trying to run an Ansible playbook with the "become: yes" stanza.  You get this error after your ansible-playbook command:

fatal: [instance-11]: FAILED! => {"changed": false, "checksum": "da39a3ee5e6b4b0d3255bfef95601890afd80709", "msg": "Unsupported parameters for (copy) module: become Supported parameters include: _original_basename, attributes, backup, checksum, content, delimiter, dest, directory_mode, follow, force, group, local_follow, mode, owner, regexp, remote_src, selevel, serole, setype, seuser, src, unsafe_writes, validate"}

Solution
Unindent the "become: yes" stanza so it is at the same level of its corresponding module.

Here is an example of an incorrect indentation:

- hosts: all
  tasks:
  - copy:
      src: /home/cooluser/swapspace.sh
      dest: /home/cooluser/swapspace.sh
      owner: cooluser
      group: wheel
      mode: 0644
      become: yes

Here is an example of a correct indentation:

- hosts: all
  tasks:
  - copy:
      src: /home/cooluser/swapspace.sh
      dest: /home/cooluser/swapspace.sh
      owner: cooluser
      group: wheel
      mode: 0644
    become: yes

Leave a comment

Your email address will not be published. Required fields are marked *