How to copy file from locate to remote host with dzdo method?

139 views
Skip to first unread message

Andrey Maraev

unread,
Nov 20, 2015, 2:51:54 PM11/20/15
to Ansible Project
Hello there! 
I try to use ansible-playbook. (ansible 1.9.4, Ubuntu 14.04)
I have dzdo -l permission like: (root) /bin/cp * /usr/local/bin
So, I wanna copy a script file from local machine to remote /usr/local/bin plz see playbook.yml below:

---
- name: Copy scrypt file into /usr/local/bin
  hosts: icinga
  gather_facts: no
  any_errors_fatal: True
  tasks:
  - name: "copy to my home directory"
    copy: src=/local/path dest=~/script.sh
  - name: "try to copy into remote /usr/loacl/bin via dzdo"
    become: yes
    become_method: dzdo
    shell: /bin/cp ~/script.sh /usr/local/bin

Finally, the first step is successfull, second get the error like: This modele doesn't support running  commands via dzdo. 
Any ideas?

Reply all
Reply to author
Forward
0 new messages