# Ansible-Pull Copy Error

**URL:** <https://forum.ansible.com/t/ansible-pull-copy-error/35962>\
**Category:** Ansible Project\
**Created:** [November 3, 2021, 8:21pm UTC](https://forum.ansible.com/t/ansible-pull-copy-error/35962 "2021-11-03T20:21:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul1](https://avatars.discourse-cdn.com/v4/letter/p/3d9bf3/32.png) [@Paul1](https://forum.ansible.com/u/Paul1)\
**Post date:** [November 3, 2021, 8:21pm UTC](https://forum.ansible.com/t/ansible-pull-copy-error/35962/1 "2021-11-03T20:21:13Z")

</div>

I was following a tutorial from a year ago so perhaps something in Ansible has changed. My issue is I get this error:

TASK [copy sudoers\_ansible] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [localhost]: FAILED! =\> {“changed”: false, “checksum”: “9c9e5aae4aa1c02a4934d7172d2c4cd6c057d15d”, “msg”: “Unsupported parameters for (ansible.legacy.copy) module: root Supported parameters include:  
\_original\_basename, attributes, backup, checksum, content, dest, directory\_mode, follow, force, group, local\_follow, mode, owner, remote\_src, selevel, serole, setype, seuser, src, unsafe\_writes, validate”}

- name: copy sudoers\_ansible  
copy:  
src: files/sudoers\_ansible  
dest: /etc/sudoers.d/ansible  
owner: root  
group: root

mode: 0440

I’ve added ansible as a system sudoer. All of the parameters I’m using; src, dest, owner, group and mode seem to be listed as supported in the error message.

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [November 3, 2021, 10:25pm UTC](https://forum.ansible.com/t/ansible-pull-copy-error/35962/2 "2021-11-03T22:25:59Z")

</div>

Are you sure this is the task that is being run?  
Try adding an extra bogus parameter, that should then be listed in the error message

---

<div class="post-metadata">

**Author:** ![Paul1](https://avatars.discourse-cdn.com/v4/letter/p/3d9bf3/32.png) [@Paul1](https://forum.ansible.com/u/Paul1)\
**Post date:** [November 3, 2021, 11:37pm UTC](https://forum.ansible.com/t/ansible-pull-copy-error/35962/3 "2021-11-03T23:37:30Z")

</div>

I added a bogus parameter to my users.yml file as follows;

- name: copy sudoers\_ansible  
copy:  
bogus: parameter  
src: files/sudoers\_ansible  
dest: /etc/sudoers.d/ansible  
owner: root  
root: root  
mode: 0440

Now the error message reads:

TASK [copy sudoers\_ansible] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [localhost]: FAILED! =\> {“changed”: false, “checksum”: “9c9e5aae4aa1c02a4934d7172d2c4cd6c057d15d”, “msg”: “Unsupported parameters for (ansible.legacy.copy) module: bogus, root Supported parameters include: \_original\_basename, attributes, backup, checksum, content, dest, directory\_mode, follow, force, group, local\_follow, mode, owner, remote\_src, selevel, serole, setype, seuser, src, unsafe\_writes, validate”}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
localhost : ok=3 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

I also verified that the destination file “/etc/sudoers.d/ansible” does not exist. The source file “~/git projects/ansible\_pull/tasks/files/sudoers\_ansible” does exist.

Paul

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [November 4, 2021, 12:39am UTC](https://forum.ansible.com/t/ansible-pull-copy-error/35962/4 "2021-11-04T00:39:54Z")

</div>

> I added a bogus parameter to my users.yml file as follows;
> 
> - name: copy sudoers\_ansible  
> copy:  
> bogus: parameter  
> src: files/sudoers\_ansible  
> dest: /etc/sudoers.d/ansible  
> owner: root  
> root: root

There is your issue.  
You didn’t post this in the first place?

---

<div class="post-metadata">

**Author:** ![Paul1](https://avatars.discourse-cdn.com/v4/letter/p/3d9bf3/32.png) [@Paul1](https://forum.ansible.com/u/Paul1)\
**Post date:** [November 4, 2021, 1:58am UTC](https://forum.ansible.com/t/ansible-pull-copy-error/35962/5 "2021-11-04T01:58:35Z")

</div>

OK, I’m lost. What is my issue? The formatting of your reply is a bit funky. But if you are talking about “mode: 0440”, that was in the initial post. Is there something wrong with that, and if so, what?

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [November 4, 2021, 6:55am UTC](https://forum.ansible.com/t/ansible-pull-copy-error/35962/6 "2021-11-04T06:55:53Z")

</div>

Hi Paul,

he was talking about the line \*\*above\*\* what he wrote, which is 'root:  
root'. That line was \*\*not\*\* included in your first post, and that's  
the line that's wrong. It must be 'user: root' (as it was in your first  
post).

> \> root: root

Cheers,  
Felix

---

<div class="post-metadata">

**Author:** ![Paul1](https://avatars.discourse-cdn.com/v4/letter/p/3d9bf3/32.png) [@Paul1](https://forum.ansible.com/u/Paul1)\
**Post date:** [November 4, 2021, 10:58pm UTC](https://forum.ansible.com/t/ansible-pull-copy-error/35962/7 "2021-11-04T22:58:09Z")

</div>

I must have been reviewing the wrong file, not the one that was being executed, because it said group: root. But the actual users.yml did have root: root and now it works as expected.

Sorry, for MY confusion.
