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
>
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
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
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
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
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
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
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?
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* ←
>
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
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
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
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',
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 }}"
14 matches
Mail list logo