Re: [ansible-project] Re: Copy multiple files to different locations on remote server

2018-11-05 Thread Keshipeddy Anusha
Could someone please help me in writing shell commands On Fri, Nov 2, 2018, 5:07 PM Keshipeddy Anusha I am trying with below playbook and getting errors > > --- > - hosts: all > tasks: > - name : replacing files > Command: > args: > src: /tmp/file1 >

Re: [ansible-project] Re: Copy multiple files to different locations on remote server

2018-11-02 Thread Keshipeddy Anusha
I am trying with below playbook and getting errors --- - hosts: all tasks: - name : replacing files Command: args: src: /tmp/file1 dest: /temp On Fri, Nov 2, 2018, 4:10 PM Mohan L Oh! yeah. I missed that part. > > On Friday, November 2, 2018 a

Re: [ansible-project] Re: Copy multiple files to different locations on remote server

2018-11-02 Thread Mohan L
Oh! yeah. I missed that part. On Friday, November 2, 2018 at 3:55:23 PM UTC+5:30, Frank Thommen wrote: > > This is not the same: > >* copy module copies from the controller (where you run the > ansible-playbook command) to the client >* cp -f copies a file locally from client to i

Re: [ansible-project] Re: Copy multiple files to different locations on remote server

2018-11-02 Thread Frank Thommen
Then your remote file is most probably identical to the one you are trying to copy ;-) Did you check that your local file (src) is for sure different from the remote one (dest)? Run `ansible-playbook` with '-vvv' to see, which local files ansible selects (this can be confusing when you are us

Re: [ansible-project] Re: Copy multiple files to different locations on remote server

2018-11-02 Thread Frank Thommen
This is not the same: * copy module copies from the controller (where you run the ansible-playbook command) to the client * cp -f copies a file locally from client to itself frank On 11/02/2018 10:25 AM, Mohan L wrote: Try with command or shell module with cp -f. On Friday, November

Re: [ansible-project] Re: Copy multiple files to different locations on remote server

2018-11-02 Thread Mohan L
Try with command or shell module with cp -f. On Friday, November 2, 2018 at 2:21:33 PM UTC+5:30, Keshipeddy Anusha wrote: > > No change Mohan > It is not replacing the file > > On Fri, Nov 2, 2018, 2:20 PM Mohan L > wrote: > >> copy module with force yes automatically replace it. Otherwise you m

Re: [ansible-project] Re: Copy multiple files to different locations on remote server

2018-11-02 Thread Keshipeddy Anusha
No change Mohan It is not replacing the file On Fri, Nov 2, 2018, 2:20 PM Mohan L copy module with force yes automatically replace it. Otherwise you may > need to delete it before copy task. > > On Thursday, November 1, 2018 at 8:11:53 PM UTC+5:30, Keshipeddy Anusha > wrote: >> >> Okay got it. Is

Re: [ansible-project] Re: Copy multiple files to different locations on remote server

2018-11-02 Thread Mohan L
copy module with force yes automatically replace it. Otherwise you may need to delete it before copy task. On Thursday, November 1, 2018 at 8:11:53 PM UTC+5:30, Keshipeddy Anusha wrote: > > Okay got it. Is there any specific module that we can use to replace a > complete file in remote server?

Re: [ansible-project] Re: Copy multiple files to different locations on remote server

2018-11-01 Thread Keshipeddy Anusha
Okay got it. Is there any specific module that we can use to replace a complete file in remote server? Thank you for your help. Thanks, Anusha On Thu, Nov 1, 2018, 8:07 PM Mohan L > What is happening when you try to use force: yes? > > *force* > bool > >*Choices:* >- no >- *yes* ← >

Re: [ansible-project] Re: Copy multiple files to different locations on remote server

2018-11-01 Thread Mohan L
What is happening when you try to use force: yes? *force* bool *Choices:* - no - *yes* ← the default is yes, which will replace the remote file when contents are different than the source. If no, the file will only be transferred if the destination does not exist. aliases: thir

Re: [ansible-project] Re: Copy multiple files to different locations on remote server

2018-10-31 Thread Keshipeddy Anusha
How to replace the existing file on remote server should we use any specific module for that? I tried using force=yes but it didn't work for me. On Tue, Oct 30, 2018, 5:30 PM Thank you Mohan that worked for me > > -- > You received this message because you are subscribed to the Google Groups

[ansible-project] Re: Copy multiple files to different locations on remote server

2018-10-30 Thread anushakeshipeddy4
Thank you Mohan that worked for me -- 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send e

[ansible-project] Re: Copy multiple files to different locations on remote server

2018-10-29 Thread Mohan L
do you want to copy multiple target like this? # cat site.yml --- - hosts: all vars: file_list: - { src: '/tmp/myfiles/file1.txt', dst: '/tmp/target1/file1.txt' } - { src: '/tmp/myfiles/file2.txt', dst: '/tmp/target2/file2.txt' } - { src: '/tmp/myfiles/file3.txt',

[ansible-project] Re: Copy multiple files to different locations on remote server

2018-10-29 Thread Mohan L
Try like this: # cat site.yml --- - hosts: all vars: file_list: - file1.txt - file2.txt - file3.txt - file4.txt tasks: - name: Copy file to target node copy: src: "/tmp/myfiles/{{ item }}" dest: "/tmp/target/{{ item }}"