Re: [ansible-project] Re: Copy module error in windows

2020-09-16 Thread rubod singh
thank you all

it worked finally.

i can start working on rest of the modules now.


On Wed, Sep 16, 2020 at 12:02 PM Dick Visser  wrote:
>
> In essence the remote_src parameter is a Boolean:
>
> https://docs.ansible.com/ansible/latest/modules/win_copy_module.html#parameter-remote_src
>
>
> On Wed, 16 Sep 2020 at 17:57, Raju Das  wrote:
>>
>>
>> - name: Copy a single file where the source is on the remote host
>>
>>   win_copy:
>>
>> src: C:\Temp\foo.txt
>>
>> dest: C:\ansible\foo.txt
>>
>> remote_src: yes   <-use this
>>
>>
>>
>> - name: Copy a folder recursively where the source is on the remote host
>>
>>   win_copy:
>>
>> src: C:\Temp
>>
>> dest: C:\ansible
>>
>> remote_src: yes   <---use this
>>
>>
>> With regards
>>
>> Raju Das
>>
>>
>>
>> On Wed, Sep 16, 2020 at 9:00 PM rubod singh  wrote:
>>>
>>> actually
>>>
>>>
>>>
>>>
>>>
>>> source file is also on windows server ( which is also the target server)
>>>
>>>
>>>
>>>
>>>
>>> do we need to mention any remote_host ?
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Wed, Sep 16, 2020 at 11:28 AM rubod singh  wrote:
>>>
>>>
>>> >
>>>
>>>
>>> > Thanks Rahul -
>>>
>>>
>>> >
>>>
>>>
>>> > got this error now
>>>
>>>
>>> >
>>>
>>>
>>> >
>>>
>>>
>>> > {
>>>
>>>
>>> > "src": "C:\\abc.txt",
>>>
>>>
>>> > "dest": "C:\\ansible\\abc.txt",
>>>
>>>
>>> > "msg": "Could not find or access 'C:\\abc.txt'\nSearched
>>>
>>>
>>> > in:\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt
>>>
>>>
>>> > on the Ansible Controller.\nIf you are using a module and expect the
>>>
>>>
>>> > file to exist on the remote, see the remote_src option",
>>>
>>>
>>> > "exception": "Traceback (most recent call last):\n  File
>>>
>>>
>>> > \"/usr/lib/python3.6/site-packages/ansible/plugins/action/win_copy.py\",
>>>
>>>
>>> > line 402, in run\nsource = self._find_needle('files', source)\n
>>>
>>>
>>> > File 
>>> > \"/usr/lib/python3.6/site-packages/ansible/plugins/action/__init__.py\",
>>>
>>>
>>> > line 1192, in _find_needle\nreturn
>>>
>>>
>>> > self._loader.path_dwim_relative_stack(path_stack, dirname, needle)\n
>>>
>>>
>>> > File \"/usr/lib/python3.6/site-packages/ansible/parsing/dataloader.py\",
>>>
>>>
>>> > line 327, in path_dwim_relative_stack\nraise
>>>
>>>
>>> > AnsibleFileNotFound(file_name=source, paths=[to_native(p) for p in
>>>
>>>
>>> > search])\nansible.errors.AnsibleFileNotFound: Could not find or access
>>>
>>>
>>> > 'C:\\abc.txt'\nSearched
>>>
>>>
>>> > in:\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt
>>>
>>>
>>> > on the Ansible Controller.\nIf you are using a module and expect the
>>>
>>>
>>> > file to exist on the remote, see the remote_src option\n",
>>>
>>>
>>> > "_ansible_no_log": false,
>>>
>>>
>>> > "changed": false
>>>
>>>
>>> > }
>>>
>>>
>>> >
>>>
>>>
>>> >
>>>
>>>
>>> >
>>>
>>>
>>> > On Wed, Sep 16, 2020 at 9:20 AM Rahul Puli  
>>> > wrote:
>>>
>>>
>>> > >
>>>
>>>
>>> > > Hello Rubod,
>>>
>>>
>>> > >
>>>
>>>
>>> > > Please try to run the below code and check.
>>>
>>>
>>> > >
>>>
>>>
>>> > > ---
>>>
>>>
>>> > > - name: "Copy Files"
>>>
>>>
>>> > > hosts: all
>>>
>>>
>>> > >
>>>
>>>
>>> > > tasks:
>>>
>>>
>>> > > - name: Copy Files
>>>
>>>
>>> > > win_copy:
>>>
>>>
>>> > >   src: C:\abc.txt
>>>
>>>
>>> > >   dest: C:\ansible\abc.txt
>>>
>>>
>>> > >
>>>
>>>
>>> > > On Wednesday, September 16, 2020 at 6:17:13 PM UTC+5:30 
>>> > > rubod...@gmail.com wrote:
>>>
>>>
>>> > >>
>>>
>>>
>>> > >> HI Team,
>>>
>>>
>>> > >>
>>>
>>>
>>> > >> please help me in this as i'm very new to this , i'm getting this
>>>
>>>
>>> > >> error while testing the simple windows file copy module through awx.
>>>
>>>
>>> > >>
>>>
>>>
>>> > >> Ansible VM is on Azure
>>>
>>>
>>> > >> Target Windows machine is also on Azure - No network restrictions as
>>>
>>>
>>> > >> this is a POC project
>>>
>>>
>>> > >>
>>>
>>>
>>> > >> playbook :
>>>
>>>
>>> > >>
>>>
>>>
>>> > >> ---
>>>
>>>
>>> > >> - name: "Copy Files"
>>>
>>>
>>> > >> hosts: all
>>>
>>>
>>> > >>
>>>
>>>
>>> > >> tasks:
>>>
>>>
>>> > >> - name: Copy Files
>>>
>>>
>>> > >> win_copy:
>>>
>>>
>>> > >> remote_src: C:\abc.txt
>>>
>>>
>>> > >> remote_dest: C:\ansible\abc.txt
>>>
>>>
>>> > >>
>>>
>>>
>>> > >>
>>>
>>>
>>> > >>
>>>
>>>
>>> > >> error :
>>>
>>>
>>> > >>
>>>
>>>
>>> > >> {
>>>
>>>
>>> > >> "src": null,
>>>
>>>
>>> > >> "dest": null,
>>>
>>>
>>> > >> "msg": "src (or content) and dest are required",
>>>
>>>
>>> > >> "_ansible_no_log": false,
>>>
>>>
>>> > >> "changed": false
>>>
>>>
>>> > >> }
>>>
>>>

Re: [ansible-project] Re: Copy module error in windows

2020-09-16 Thread Dick Visser
In essence the remote_src parameter is a Boolean:

https://docs.ansible.com/ansible/latest/modules/win_copy_module.html#parameter-remote_src


On Wed, 16 Sep 2020 at 17:57, Raju Das  wrote:

>
> - name: Copy a single file where the source is on the remote host
>
>   win_copy:
>
> src: C:\Temp\foo.txt
>
> dest: C:\ansible\foo.txt
>
>
>
> *remote_src: yes   <-use this*
>
> - name: Copy a folder recursively where the source is on the remote host
>
>   win_copy:
>
> src: C:\Temp
>
> dest: C:\ansible
>
>* remote_src: yes   <---use this*
>
>
> *With regards*
>
> *Raju Das*
>
>
>
> On Wed, Sep 16, 2020 at 9:00 PM rubod singh  wrote:
>
>> actually
>>
>>
>>
>>
>>
>> source file is also on windows server ( which is also the target server)
>>
>>
>>
>>
>>
>> do we need to mention any remote_host ?
>>
>>
>>
>>
>>
>>
>>
>>
>> On Wed, Sep 16, 2020 at 11:28 AM rubod singh 
>> wrote:
>>
>>
>> >
>>
>>
>> > Thanks Rahul -
>>
>>
>> >
>>
>>
>> > got this error now
>>
>>
>> >
>>
>>
>> >
>>
>>
>> > {
>>
>>
>> > "src": "C:\\abc.txt",
>>
>>
>> > "dest": "C:\\ansible\\abc.txt",
>>
>>
>> > "msg": "Could not find or access 'C:\\abc.txt'\nSearched
>>
>>
>> >
>> in:\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt
>>
>>
>> > on the Ansible Controller.\nIf you are using a module and expect the
>>
>>
>> > file to exist on the remote, see the remote_src option",
>>
>>
>> > "exception": "Traceback (most recent call last):\n  File
>>
>>
>> > \"/usr/lib/python3.6/site-packages/ansible/plugins/action/win_copy.py\",
>>
>>
>> > line 402, in run\nsource = self._find_needle('files', source)\n
>>
>>
>> > File
>> \"/usr/lib/python3.6/site-packages/ansible/plugins/action/__init__.py\",
>>
>>
>> > line 1192, in _find_needle\nreturn
>>
>>
>> > self._loader.path_dwim_relative_stack(path_stack, dirname, needle)\n
>>
>>
>> > File \"/usr/lib/python3.6/site-packages/ansible/parsing/dataloader.py\",
>>
>>
>> > line 327, in path_dwim_relative_stack\nraise
>>
>>
>> > AnsibleFileNotFound(file_name=source, paths=[to_native(p) for p in
>>
>>
>> > search])\nansible.errors.AnsibleFileNotFound: Could not find or access
>>
>>
>> > 'C:\\abc.txt'\nSearched
>>
>>
>> >
>> in:\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt
>>
>>
>> > on the Ansible Controller.\nIf you are using a module and expect the
>>
>>
>> > file to exist on the remote, see the remote_src option\n",
>>
>>
>> > "_ansible_no_log": false,
>>
>>
>> > "changed": false
>>
>>
>> > }
>>
>>
>> >
>>
>>
>> >
>>
>>
>> >
>>
>>
>> > On Wed, Sep 16, 2020 at 9:20 AM Rahul Puli 
>> wrote:
>>
>>
>> > >
>>
>>
>> > > Hello Rubod,
>>
>>
>> > >
>>
>>
>> > > Please try to run the below code and check.
>>
>>
>> > >
>>
>>
>> > > ---
>>
>>
>> > > - name: "Copy Files"
>>
>>
>> > > hosts: all
>>
>>
>> > >
>>
>>
>> > > tasks:
>>
>>
>> > > - name: Copy Files
>>
>>
>> > > win_copy:
>>
>>
>> > >   src: C:\abc.txt
>>
>>
>> > >   dest: C:\ansible\abc.txt
>>
>>
>> > >
>>
>>
>> > > On Wednesday, September 16, 2020 at 6:17:13 PM UTC+5:30
>> rubod...@gmail.com wrote:
>>
>>
>> > >>
>>
>>
>> > >> HI Team,
>>
>>
>> > >>
>>
>>
>> > >> please help me in this as i'm very new to this , i'm getting this
>>
>>
>> > >> error while testing the simple windows file copy module through awx.
>>
>>
>> > >>
>>
>>
>> > >> Ansible VM is on Azure
>>
>>
>> > >> Target Windows machine is also on Azure - No network restrictions as
>>
>>
>> > >> this is a POC project
>>
>>
>> > >>
>>
>>
>> > >> playbook :
>>
>>
>> > >>
>>
>>
>> > >> ---
>>
>>
>> > >> - name: "Copy Files"
>>
>>
>> > >> hosts: all
>>
>>
>> > >>
>>
>>
>> > >> tasks:
>>
>>
>> > >> - name: Copy Files
>>
>>
>> > >> win_copy:
>>
>>
>> > >> remote_src: C:\abc.txt
>>
>>
>> > >> remote_dest: C:\ansible\abc.txt
>>
>>
>> > >>
>>
>>
>> > >>
>>
>>
>> > >>
>>
>>
>> > >> error :
>>
>>
>> > >>
>>
>>
>> > >> {
>>
>>
>> > >> "src": null,
>>
>>
>> > >> "dest": null,
>>
>>
>> > >> "msg": "src (or content) and dest are required",
>>
>>
>> > >> "_ansible_no_log": false,
>>
>>
>> > >> "changed": false
>>
>>
>> > >> }
>>
>>
>> > >>
>>
>>
>> > >>
>>
>>
>> > >> Any help is appreciated.
>>
>>
>> > >>
>>
>>
>> > >> Thanks
>>
>>
>> > >>
>>
>>
>> > >> Rubod
>>
>>
>> > >
>>
>>
>> > > --
>>
>>
>> > > 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 view this discussion on

Re: [ansible-project] Re: Copy module error in windows

2020-09-16 Thread Raju Das
- name: Copy a single file where the source is on the remote host
  win_copy:
src: C:\Temp\foo.txt
dest: C:\ansible\foo.txt
*remote_src: yes   <-use this
*- name: Copy a folder recursively where the source is on the remote host
  win_copy:
src: C:\Temp
dest: C:\ansible
   * remote_src: yes   <---use this*


*With regards*

*Raju Das*



On Wed, Sep 16, 2020 at 9:00 PM rubod singh  wrote:

> actually
>
> source file is also on windows server ( which is also the target server)
>
> do we need to mention any remote_host ?
>
>
> On Wed, Sep 16, 2020 at 11:28 AM rubod singh 
> wrote:
> >
> > Thanks Rahul -
> >
> > got this error now
> >
> >
> > {
> > "src": "C:\\abc.txt",
> > "dest": "C:\\ansible\\abc.txt",
> > "msg": "Could not find or access 'C:\\abc.txt'\nSearched
> >
> in:\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt
> > on the Ansible Controller.\nIf you are using a module and expect the
> > file to exist on the remote, see the remote_src option",
> > "exception": "Traceback (most recent call last):\n  File
> > \"/usr/lib/python3.6/site-packages/ansible/plugins/action/win_copy.py\",
> > line 402, in run\nsource = self._find_needle('files', source)\n
> > File
> \"/usr/lib/python3.6/site-packages/ansible/plugins/action/__init__.py\",
> > line 1192, in _find_needle\nreturn
> > self._loader.path_dwim_relative_stack(path_stack, dirname, needle)\n
> > File \"/usr/lib/python3.6/site-packages/ansible/parsing/dataloader.py\",
> > line 327, in path_dwim_relative_stack\nraise
> > AnsibleFileNotFound(file_name=source, paths=[to_native(p) for p in
> > search])\nansible.errors.AnsibleFileNotFound: Could not find or access
> > 'C:\\abc.txt'\nSearched
> >
> in:\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt
> > on the Ansible Controller.\nIf you are using a module and expect the
> > file to exist on the remote, see the remote_src option\n",
> > "_ansible_no_log": false,
> > "changed": false
> > }
> >
> >
> >
> > On Wed, Sep 16, 2020 at 9:20 AM Rahul Puli 
> wrote:
> > >
> > > Hello Rubod,
> > >
> > > Please try to run the below code and check.
> > >
> > > ---
> > > - name: "Copy Files"
> > > hosts: all
> > >
> > > tasks:
> > > - name: Copy Files
> > > win_copy:
> > >   src: C:\abc.txt
> > >   dest: C:\ansible\abc.txt
> > >
> > > On Wednesday, September 16, 2020 at 6:17:13 PM UTC+5:30
> rubod...@gmail.com wrote:
> > >>
> > >> HI Team,
> > >>
> > >> please help me in this as i'm very new to this , i'm getting this
> > >> error while testing the simple windows file copy module through awx.
> > >>
> > >> Ansible VM is on Azure
> > >> Target Windows machine is also on Azure - No network restrictions as
> > >> this is a POC project
> > >>
> > >> playbook :
> > >>
> > >> ---
> > >> - name: "Copy Files"
> > >> hosts: all
> > >>
> > >> tasks:
> > >> - name: Copy Files
> > >> win_copy:
> > >> remote_src: C:\abc.txt
> > >> remote_dest: C:\ansible\abc.txt
> > >>
> > >>
> > >>
> > >> error :
> > >>
> > >> {
> > >> "src": null,
> > >> "dest": null,
> > >> "msg": "src (or content) and dest are required",
> > >> "_ansible_no_log": false,
> > >> "changed": false
> > >> }
> > >>
> > >>
> > >> Any help is appreciated.
> > >>
> > >> Thanks
> > >>
> > >> Rubod
> > >
> > > --
> > > 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/f508c5c1-68b7-43f4-a7fd-7dd2712a6f94n%40googlegroups.com
> .
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CADiG6us0%2Bo3%2BZ8KGrETSkBGHaWaE9gUbSBWiSt0%2BXsD5LxpRFg%40mail.gmail.com
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAApSnDD8ALusw2H%2BV12Y_1ujkKPjyDtotjK8naCQFDRRifO90g%40mail.gmail.com.


Re: [ansible-project] Re: Copy module error in windows

2020-09-16 Thread rubod singh
actually

source file is also on windows server ( which is also the target server)

do we need to mention any remote_host ?


On Wed, Sep 16, 2020 at 11:28 AM rubod singh  wrote:
>
> Thanks Rahul -
>
> got this error now
>
>
> {
> "src": "C:\\abc.txt",
> "dest": "C:\\ansible\\abc.txt",
> "msg": "Could not find or access 'C:\\abc.txt'\nSearched
> in:\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt
> on the Ansible Controller.\nIf you are using a module and expect the
> file to exist on the remote, see the remote_src option",
> "exception": "Traceback (most recent call last):\n  File
> \"/usr/lib/python3.6/site-packages/ansible/plugins/action/win_copy.py\",
> line 402, in run\nsource = self._find_needle('files', source)\n
> File \"/usr/lib/python3.6/site-packages/ansible/plugins/action/__init__.py\",
> line 1192, in _find_needle\nreturn
> self._loader.path_dwim_relative_stack(path_stack, dirname, needle)\n
> File \"/usr/lib/python3.6/site-packages/ansible/parsing/dataloader.py\",
> line 327, in path_dwim_relative_stack\nraise
> AnsibleFileNotFound(file_name=source, paths=[to_native(p) for p in
> search])\nansible.errors.AnsibleFileNotFound: Could not find or access
> 'C:\\abc.txt'\nSearched
> in:\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt
> on the Ansible Controller.\nIf you are using a module and expect the
> file to exist on the remote, see the remote_src option\n",
> "_ansible_no_log": false,
> "changed": false
> }
>
>
>
> On Wed, Sep 16, 2020 at 9:20 AM Rahul Puli  wrote:
> >
> > Hello Rubod,
> >
> > Please try to run the below code and check.
> >
> > ---
> > - name: "Copy Files"
> > hosts: all
> >
> > tasks:
> > - name: Copy Files
> > win_copy:
> >   src: C:\abc.txt
> >   dest: C:\ansible\abc.txt
> >
> > On Wednesday, September 16, 2020 at 6:17:13 PM UTC+5:30 rubod...@gmail.com 
> > wrote:
> >>
> >> HI Team,
> >>
> >> please help me in this as i'm very new to this , i'm getting this
> >> error while testing the simple windows file copy module through awx.
> >>
> >> Ansible VM is on Azure
> >> Target Windows machine is also on Azure - No network restrictions as
> >> this is a POC project
> >>
> >> playbook :
> >>
> >> ---
> >> - name: "Copy Files"
> >> hosts: all
> >>
> >> tasks:
> >> - name: Copy Files
> >> win_copy:
> >> remote_src: C:\abc.txt
> >> remote_dest: C:\ansible\abc.txt
> >>
> >>
> >>
> >> error :
> >>
> >> {
> >> "src": null,
> >> "dest": null,
> >> "msg": "src (or content) and dest are required",
> >> "_ansible_no_log": false,
> >> "changed": false
> >> }
> >>
> >>
> >> Any help is appreciated.
> >>
> >> Thanks
> >>
> >> Rubod
> >
> > --
> > 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 view this discussion on the web visit 
> > https://groups.google.com/d/msgid/ansible-project/f508c5c1-68b7-43f4-a7fd-7dd2712a6f94n%40googlegroups.com.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CADiG6us0%2Bo3%2BZ8KGrETSkBGHaWaE9gUbSBWiSt0%2BXsD5LxpRFg%40mail.gmail.com.


Re: [ansible-project] Re: Copy module error in windows

2020-09-16 Thread rubod singh
Thanks Rahul -

got this error now


{
"src": "C:\\abc.txt",
"dest": "C:\\ansible\\abc.txt",
"msg": "Could not find or access 'C:\\abc.txt'\nSearched
in:\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt
on the Ansible Controller.\nIf you are using a module and expect the
file to exist on the remote, see the remote_src option",
"exception": "Traceback (most recent call last):\n  File
\"/usr/lib/python3.6/site-packages/ansible/plugins/action/win_copy.py\",
line 402, in run\nsource = self._find_needle('files', source)\n
File \"/usr/lib/python3.6/site-packages/ansible/plugins/action/__init__.py\",
line 1192, in _find_needle\nreturn
self._loader.path_dwim_relative_stack(path_stack, dirname, needle)\n
File \"/usr/lib/python3.6/site-packages/ansible/parsing/dataloader.py\",
line 327, in path_dwim_relative_stack\nraise
AnsibleFileNotFound(file_name=source, paths=[to_native(p) for p in
search])\nansible.errors.AnsibleFileNotFound: Could not find or access
'C:\\abc.txt'\nSearched
in:\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/files/C:\\abc.txt\n\t/tmp/awx_81_g9rtokz0/project/projects/AWX_POC/C:\\abc.txt
on the Ansible Controller.\nIf you are using a module and expect the
file to exist on the remote, see the remote_src option\n",
"_ansible_no_log": false,
"changed": false
}



On Wed, Sep 16, 2020 at 9:20 AM Rahul Puli  wrote:
>
> Hello Rubod,
>
> Please try to run the below code and check.
>
> ---
> - name: "Copy Files"
> hosts: all
>
> tasks:
> - name: Copy Files
> win_copy:
>   src: C:\abc.txt
>   dest: C:\ansible\abc.txt
>
> On Wednesday, September 16, 2020 at 6:17:13 PM UTC+5:30 rubod...@gmail.com 
> wrote:
>>
>> HI Team,
>>
>> please help me in this as i'm very new to this , i'm getting this
>> error while testing the simple windows file copy module through awx.
>>
>> Ansible VM is on Azure
>> Target Windows machine is also on Azure - No network restrictions as
>> this is a POC project
>>
>> playbook :
>>
>> ---
>> - name: "Copy Files"
>> hosts: all
>>
>> tasks:
>> - name: Copy Files
>> win_copy:
>> remote_src: C:\abc.txt
>> remote_dest: C:\ansible\abc.txt
>>
>>
>>
>> error :
>>
>> {
>> "src": null,
>> "dest": null,
>> "msg": "src (or content) and dest are required",
>> "_ansible_no_log": false,
>> "changed": false
>> }
>>
>>
>> Any help is appreciated.
>>
>> Thanks
>>
>> Rubod
>
> --
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/f508c5c1-68b7-43f4-a7fd-7dd2712a6f94n%40googlegroups.com.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CADiG6uuXZ77Av89XjwgxOGHEpFzk1WQZSX2Ody4m5wmVDbG82A%40mail.gmail.com.


[ansible-project] Re: Copy module error in windows

2020-09-16 Thread Rahul Puli
Hello Rubod,

Please try to run the below code and check.

--- 
- name: "Copy Files" 
hosts: all 

tasks: 
- name: Copy Files 
win_copy: 
  src: C:\abc.txt 
  dest: C:\ansible\abc.txt 

On Wednesday, September 16, 2020 at 6:17:13 PM UTC+5:30 rubod...@gmail.com 
wrote:

> HI Team,
>
> please help me in this as i'm very new to this , i'm getting this
> error while testing the simple windows file copy module through awx.
>
> Ansible VM is on Azure
> Target Windows machine is also on Azure - No network restrictions as
> this is a POC project
>
> playbook :
>
> ---
> - name: "Copy Files"
> hosts: all
>
> tasks:
> - name: Copy Files
> win_copy:
> remote_src: C:\abc.txt
> remote_dest: C:\ansible\abc.txt
>
>
>
> error :
>
> {
> "src": null,
> "dest": null,
> "msg": "src (or content) and dest are required",
> "_ansible_no_log": false,
> "changed": false
> }
>
>
> Any help is appreciated.
>
> Thanks
>
> Rubod
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f508c5c1-68b7-43f4-a7fd-7dd2712a6f94n%40googlegroups.com.


[ansible-project] Re: Copy module

2018-03-08 Thread Malcolm Hussain-Gambles
It's not a network issue. Local and remote are localhost.
The speed issues seem to be down to abuse of ansible.
Just to process the files dictionary list into a sensible format took over 
three hours (I gave up) and used 12Gb of ram.
Using a shell script takes less than a second.
Ansible is doing a lot of checks, that in this instance are pointless.
There is a lot of manipulation of data as well, that would be far easier in 
python too.
So a module to make an rpm I think is the way to go. 

-- 
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 email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c62ccbab-be8a-46d9-a103-bd7f625e04a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Copy module

2018-03-07 Thread Thijn Bukkems
My copy speeds greatly increased when I moved the package source to the 
same datacenter as the target resources. Could it be a location issue where 
your network speed gets throttled? 

On Tuesday, 6 March 2018 13:05:15 UTC-8, Malcolm Hussain-Gambles wrote:
>
> I'm using ansible to build a package in Jenkins and the make an rpm.
> The copy function takes 20+ minutes to copy a few files. Using the command 
> function takes under a second.
> The synchronize function is generally unusable (better off using rsync 
> from command)
>
> I was wondering what other people's experiences are with copy and 
> synchronize.
>

-- 
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 email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/052914da-5ee7-4ba7-87de-d1da13f72c38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Copy module

2018-03-07 Thread senorsmile
I have had great success with the synchronize module as of Ansible 2.4. 

In my opinion, your use case sounds like reasoning to create a custom 
module. 

On Wednesday, March 7, 2018 at 11:03:36 AM UTC-8, Malcolm Hussain-Gambles 
wrote:
>
> After further investigation it appears there are a lot of serious short 
> comings using ansible directly to build an rpm.
> It looks like it's not a fault with ansible per say, just how I'm trying 
> to (ab)use it.
> The thought occurs about writing an ansible module to make rpms.
> Would there be wider interest in this?

-- 
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 email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/890b14ee-c82b-40d9-b63e-6529f0cbe875%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Copy Module doesnt override destination file

2016-08-09 Thread Anushri Mishra
k got it.thx.

On Monday, August 8, 2016 at 12:56:44 PM UTC-4, Anushri Mishra wrote:
>
> hi,
>
> so this is what I have in my yml file:
>
> -   name: Copy War File
>
> copy: src=externaluserwebapi.war dest=/usr/share/tomcat7/webapps
>
> become: True
>
> become_method: sudo
>
> and this is what I get when I run playbook:
>
> ok: [10.1.33.227] => {"changed": false, "checksum": 
> "c93572d33bd0555a87341380ac389382c225a92d", "dest": 
> "/usr/share/tomcat7/webapps/externaluserwebapi.war", "gid": 0, "group": 
> "root", "invocation": {"module_args": {"backup": false, "content": null, 
> "delimiter": null, "dest": 
> "/usr/share/tomcat7/webapps/externaluserwebapi.war", "directory_mode": 
> null, "follow": false, "force": true, "group": null, "mode": null, 
> "original_basename": "externaluserwebapi.war", "owner": null, "regexp": 
> null, "remote_src": null, "selevel": null, "serole": null, "setype": null, 
> "seuser": null, "src": 
> "/home/ec2-user/.ansible/tmp/ansible-tmp-1470673998.42-1732776252/source",
>  
> "validate": null}}, "md5sum": "ba5224fb84a5f82d5fa7b8a8f83c4b2e", "mode": 
> "0644", "owner": "root", "size": 17027813, "src": 
> "/home/ec2-user/.ansible/tmp/ansible-tmp-1470673998.42-1732776252/source",
>  
> "state": "file", "uid": 0}
>
>
>
> Not sure why but copy module is not overriding the script in destination 
> directory.I read that by default it is force=yes.Please help.
>

-- 
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 email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/09deadee-3212-4b7a-a177-16b6149fc8c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Copy Module doesnt override destination file

2016-08-09 Thread Kai Stian Olstad

On 09. aug. 2016 23:34, Anushri Mishra wrote:

Thanks Kai.Yes,the files are identical.But there should be some way to
overwrite it.Is there any way?


No, this is part of Ansibles idempontecy[1], it does not do any changes 
if the files is identical.
Why do you want to overwrite the file if it's identical, overwrite it 
will have no function since nothing will change.



[1] https://docs.ansible.com/ansible/glossary.html#term-idempotency

--
Kai Stian Olstad

--
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 email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6b947ea4-c9e2-fcb3-4943-5d730144139f%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Copy Module doesnt override destination file

2016-08-09 Thread Anushri Mishra
Thanks Kai.Yes,the files are identical.But there should be some way to 
overwrite it.Is there any way?

On Monday, August 8, 2016 at 12:56:44 PM UTC-4, Anushri Mishra wrote:
>
> hi,
>
> so this is what I have in my yml file:
>
> -   name: Copy War File
>
> copy: src=externaluserwebapi.war dest=/usr/share/tomcat7/webapps
>
> become: True
>
> become_method: sudo
>
> and this is what I get when I run playbook:
>
> ok: [10.1.33.227] => {"changed": false, "checksum": 
> "c93572d33bd0555a87341380ac389382c225a92d", "dest": 
> "/usr/share/tomcat7/webapps/externaluserwebapi.war", "gid": 0, "group": 
> "root", "invocation": {"module_args": {"backup": false, "content": null, 
> "delimiter": null, "dest": 
> "/usr/share/tomcat7/webapps/externaluserwebapi.war", "directory_mode": 
> null, "follow": false, "force": true, "group": null, "mode": null, 
> "original_basename": "externaluserwebapi.war", "owner": null, "regexp": 
> null, "remote_src": null, "selevel": null, "serole": null, "setype": null, 
> "seuser": null, "src": 
> "/home/ec2-user/.ansible/tmp/ansible-tmp-1470673998.42-1732776252/source",
>  
> "validate": null}}, "md5sum": "ba5224fb84a5f82d5fa7b8a8f83c4b2e", "mode": 
> "0644", "owner": "root", "size": 17027813, "src": 
> "/home/ec2-user/.ansible/tmp/ansible-tmp-1470673998.42-1732776252/source",
>  
> "state": "file", "uid": 0}
>
>
>
> Not sure why but copy module is not overriding the script in destination 
> directory.I read that by default it is force=yes.Please help.
>

-- 
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 email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1225cef6-e430-4e6e-94e8-0bd4f3c06c10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: copy module with_first_found strange behavour

2015-03-27 Thread ansible_user
i have solved it by changing

 - "./files/id_rsa"

to

 - "files/id_rsa"

Not sure why the behavior differs between "with_first_found" and 
"with_items"

On Friday, March 27, 2015 at 3:01:50 PM UTC, ansible_user wrote:
>
> i have the following:
>
>
> -  copy: src={{ item }} dest="/var/lib/one/.ssh/id_rsa" owner=oneadmin 
> group=oneadmin mode=0600
>with_first_found:
>  - "./files/id_rsa"
>
> This  creates "/var/lib/one/.ssh/id_rsa/files/" folder at the destination 
> instead of copying the file. If i use "with_items" instead of 
> "with_first_found" it behaves normally.
>
> is this a bug? im running latest ansible 1.9.0.1 and the destination 
> server is ubuntu 14.04
>
> thanks
>

-- 
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 email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/cc24a666-0f33-4511-88f2-252cb58406a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.