Thank you for that clarification.
The copy: mdule works as you described.

Dave

On Thursday, October 10, 2019 at 1:02:14 PM UTC-6, David McPherson wrote:
>
> I am attempting to copy a file from the local ansible server to the 
> managed hosts (oracle linux).  
> I would like to push the file out to the different managed hosts because 
> if I call back to the Ansible server from the hosts them I have to login, 
> provide password etc.
> Pushing from the ansible host is easier because the ssl keys have been 
> copied to all the hosts and therefore is passwordless.
>
> I haven't found another way to do it other than using shell or command, 
> copy seems to be for transfering files within the client file system
>
> I also looked at delegate_to: but there really wasn't enough documentation 
> for me to figure out how to make that work.
>
> This is what I have so far but it's reaching back to the ansible server 
> for the file which requires a login.
>
> Any help would be appreciated.
>
> Dave
>
> ---
> - hosts: 'ud-mgmt-srv'
>   become: true
>   get_info: false
>   tasks:
>   - name: Check httpdate rpm
>     stat: path=/tmp/htpdate-1.1.0-1.el7.rf.x86_64.rpm
>     register: st
>
>   - name: Copy httpdate rpm
>     command: scp 10.236.1.57:/tmp/htpdate-1.1.0-1.el7.rf.x86_64.rpm /tmp/.
>     when: not st.stat.exists
>
>   - name: Install htpdate
>     yum:
>       name: /tmp/htpdate-1.1.0-1.el7.rf.x86_64.rpm
>       state: present
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2a8b25ca-315d-4622-89cb-8b970c1cc8d3%40googlegroups.com.

Reply via email to