Synchronize module failing

26 views
Skip to first unread message

Prady A

unread,
Nov 16, 2023, 7:56:24 AM11/16/23
to ansible...@googlegroups.com
Hi Experts

One doubt with synchronize module 

 - name: Unix common script deployment
    synchronize: 
          src: “{{ playbook_dir }}/shellscript” 
          Dest: /tmp/patch_impl 
     delegation_to: all

 In this ansible code it is failing because to run synchronize we need rsynch module in both control as well as managed nodes. But to overcome that can we use container method? Inside the requirement.txt can we add rsync module to build a image out it and use in the template? 

 My container file structure 
 1. _build/requirement.txt 
 2. Contanerfile 
 3. krb5.conf 
 4. pip.conf 
 5. uib.repo

Regards 
Prady

Dick Visser

unread,
Nov 16, 2023, 8:10:35 AM11/16/23
to ansible...@googlegroups.com
On Thu, 16 Nov 2023 at 13:56, Prady A <pradyu...@gmail.com> wrote:
Hi Experts

One doubt with synchronize module 

 - name: Unix common script deployment
    synchronize: 
          src: “{{ playbook_dir }}/shellscript” 
          Dest: /tmp/patch_impl 
     delegation_to: all

 In this ansible code it is failing because to run synchronize we need rsynch module in both control as well as managed nodes. But to overcome that can we use container method? Inside the requirement.txt can we add rsync module to build a image out it and use in the template? 

You can use whatever you want, as long as there will be a working rsync command on both control and managed nodes.

Dick

Prady A

unread,
Nov 16, 2023, 8:24:14 AM11/16/23
to ansible...@googlegroups.com
Thank you for your kind reply 

No some target machine don’t have rsync installed.
What to do in that case ?

Regards 

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

Felix Fontein

unread,
Nov 16, 2023, 8:37:13 AM11/16/23
to ansible...@googlegroups.com
Hi,

> Thank you for your kind reply
>
> No some target machine don’t have rsync installed.
> What to do in that case ?

install rsync on the target machines before using the synchronize
module. (For example using the ansible.builtin.package action:
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/package_module.html.)

Best regards,
Felix

Prady A

unread,
Nov 16, 2023, 7:35:35 PM11/16/23
to ansible...@googlegroups.com
Thank you for your guidance .. 

Regards 
Prady

--
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-proje...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages