# Trying to copy ntp.conf from source sever to destination server failing

**URL:** <https://forum.ansible.com/t/trying-to-copy-ntp-conf-from-source-sever-to-destination-server-failing/23998>\
**Category:** Ansible Project\
**Created:** [March 17, 2017, 12:47pm UTC](https://forum.ansible.com/t/trying-to-copy-ntp-conf-from-source-sever-to-destination-server-failing/23998 "2017-03-17T12:47:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Potvin](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@Mike\_Potvin](https://forum.ansible.com/u/Mike_Potvin)\
**Post date:** [March 17, 2017, 12:47pm UTC](https://forum.ansible.com/t/trying-to-copy-ntp-conf-from-source-sever-to-destination-server-failing/23998/1 "2017-03-17T12:47:40Z")

</div>

I’m able to run an ad-hoc command that can send the ntp,conf file from source to destination server /tmp directory as my normal user id. However when I try to copy to /etc/ I get permission denied. I do have sudo rights on destination server.

I’m trying to write a playbook that will move the file with my escalated credentials and it is failing.

vi of main.yml for ntp.yml playbook:

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [March 17, 2017, 2:07pm UTC](https://forum.ansible.com/t/trying-to-copy-ntp-conf-from-source-sever-to-destination-server-failing/23998/2 "2017-03-17T14:07:06Z")

</div>

- name install ntp config file  
&nbsp;&nbsp;&nbsp;&nbsp;become: true  
&nbsp;&nbsp;- copy:  
&nbsp;&nbsp;&nbsp;&nbsp;src: /etc/ntp.conf  
&nbsp;&nbsp;&nbsp;&nbsp;dest: /etc/ntp.conf  
&nbsp;&nbsp;&nbsp;&nbsp;owner: root  
&nbsp;&nbsp;&nbsp;&nbsp;group: root  
&nbsp;&nbsp;&nbsp;&nbsp;mode: 0644

These are 2 tasks, you are not applying become to copy. Your  
indentation is also all wrong.

&nbsp;&nbsp;- name install ntp config file  
&nbsp;&nbsp;&nbsp;&nbsp;become: true  
&nbsp;&nbsp;&nbsp;&nbsp;copy:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;src: /etc/ntp.conf  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dest: /etc/ntp.conf  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;owner: root  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;group: root  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mode: 0644
