Re: [ansible-project] Ansible Copy Files

2016-10-12 Thread novice1023
On Wednesday, October 12, 2016 at 4:29:19 AM UTC-5, Kai Stian Olstad wrote:

> On 11.10.2016 22:49, novic...@gmail.com wrote: 
>
> "You still may need to call rsync directly via command or shell 
> depending on your use case. synchronize does not provide access to the 
> full power of rsync, but does make most invocations easier to follow."  
>

That is good to know.
 

> > Is, what I am trying to do, beyond Ansible's scope? 
>
> No, but the module have not implemented everything and what you are 
> trying to do is probably not implemented yet. 
> It OK to use command and shell module, they are included for a reason. 
>

Right!
 

> > If not, how should 
> > I do it? If yes, is there a better tool to achieve this? 
>
> - If you have the skills, you could make the changes to the module and 
> send a pull request on Github. 
> - Alternative is to pay someone to do it for you. 
> - Or just use command module and rsync. 
>
> Sounds good, 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/1f577220-6dc7-4e65-b2bd-8571d44f3758%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible Copy Files

2016-10-12 Thread novice1023


On Wednesday, October 12, 2016 at 4:29:19 AM UTC-5, Kai Stian Olstad wrote:
>
> On 11.10.2016 22:49, novic...@gmail.com  wrote: 
>
> "You still may need to call rsync directly via command or shell 
> depending on your use case. synchronize does not provide access to the 
> full power of rsync, but does make most invocations easier to follow."  
>

That is good to know.
 

> > Is, what I am trying to do, beyond Ansible's scope? 
>
> No, but the module have not implemented everything and what you are 
> trying to do is probably not implemented yet. 
> It OK to use command and shell module, they are included for a reason. 
>

Right!
 

> > If not, how should 
> > I do it? If yes, is there a better tool to achieve this? 
>
> - If you have the skills, you could make the changes to the module and 
> send a pull request on Github. 
> - Alternative is to pay someone to do it for you. 
> - Or just use command module and rsync. 
>
> Sounds good, thanks!

Harish
 

-- 
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/f6516d14-2486-4d03-81bf-b604386dc437%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible Copy Files

2016-10-12 Thread Kai Stian Olstad

On 11.10.2016 22:49, novice1...@gmail.com wrote:
Oh sure, but I don't really have a problem with the message itself. I 
am
just wondering: if 'Ansible' thinks there is a better way to do it 
(because

of a module the project provides), what am I doing wrong with my
configuration that I cannot achive what I want in an officially 
supported

way.


The message is just printed since you are using rsync in command module.
It doesn't mean that Ansible has analysed your code and thinks there is 
a better way to do it.

Think of it a message to someone that doesn't now synchronize exist.

The documentation clearly says synchronize is a basic wrapper around 
rsync, from the documentation:
"You still may need to call rsync directly via command or shell 
depending on your use case. synchronize does not provide access to the 
full power of rsync, but does make most invocations easier to follow."




Is, what I am trying to do, beyond Ansible's scope?


No, but the module have not implemented everything and what you are 
trying to do is probably not implemented yet.

It OK to use command and shell module, they are included for a reason.



If not, how should
I do it? If yes, is there a better tool to achieve this?


- If you have the skills, you could make the changes to the module and 
send a pull request on Github.

- Alternative is to pay someone to do it for you.
- Or just use command module and rsync.

--
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/c3ff377bc3844cb634d3be13ac37dc6e%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible Copy Files

2016-10-11 Thread novice1023
Oh sure, but I don't really have a problem with the message itself. I am 
just wondering: if 'Ansible' thinks there is a better way to do it (because 
of a module the project provides), what am I doing wrong with my 
configuration that I cannot achive what I want in an officially supported 
way. Is, what I am trying to do, beyond Ansible's scope? If not, how should 
I do it? If yes, is there a better tool to achieve this?


On Tuesday, October 11, 2016 at 3:43:35 PM UTC-5, Kai Stian Olstad wrote:
>
> On 11. okt. 2016 22:31, novic...@gmail.com  wrote: 
> > #!/usr/bin/env ansible-playbook 
> > --- 
> > vars: 
> >   src_dir: /path/files 
> > hosts: {{ targets }} 
> > tasks: 
> >   - name: copying files 
> > command: "rsync -avrcz X:{{ src_dir }}/{{ artifacts }} {{ dest_dir 
> }}" 
> > 
> > My command line: 
> > 
> > ./playbook.yml -e '{"targets": "targets", "artifacts" : 
> "{file1,file2,dir/file_x}", "dest_dir": "/yserv/dest/path"}' 
> > 
> > This works and I am able to parallelize pretty decently, but I keep 
> getting: 
> > 
> > [WARNING]: Consider using synchronize module rather than running rsync 
>
> You can silence the messages by setting "warn: false" on the command task. 
> Can also be turn off globally by setting "command_warnings = False" in 
> ansible.cfg 
>
> -- 
> 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/77ed076f-a574-4e48-bf42-483b1671a848%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible Copy Files

2016-10-11 Thread Kai Stian Olstad

On 11. okt. 2016 22:31, novice1...@gmail.com wrote:

#!/usr/bin/env ansible-playbook
---
vars:
  src_dir: /path/files
hosts: {{ targets }}
tasks:
  - name: copying files
command: "rsync -avrcz X:{{ src_dir }}/{{ artifacts }} {{ dest_dir }}"

My command line:

./playbook.yml -e '{"targets": "targets", "artifacts" : "{file1,file2,dir/file_x}", 
"dest_dir": "/yserv/dest/path"}'

This works and I am able to parallelize pretty decently, but I keep getting:

[WARNING]: Consider using synchronize module rather than running rsync


You can silence the messages by setting "warn: false" on the command task.
Can also be turn off globally by setting "command_warnings = False" in 
ansible.cfg


--
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/4fc5199f-7094-fad8-e1fa-049e411600e3%40olstad.com.
For more options, visit https://groups.google.com/d/optout.