settings { logfile = "/var/log/lsyncd/lsyncd.log", statusFile = "/var/log/lsyncd/lsyncd-status.log", statusInterval = 20 } {% for node in groups['pkg_repo'] %} {% if groups['pkg_repo'][0] != node %} sync { default.rsync, source = "{{ repo_service_home_folder }}/repo", target = "{{ hostvars[node]['ansible_ssh_host'] }}:{{ repo_service_home_folder }}/repo", rsync = { compress = true, acls = true, rsh = "/usr/bin/ssh -l {{ repo_service_user_name }} -i {{ repo_service_home_folder }}/.ssh/id_rsa -o StrictHostKeyChecking=no -o ServerAliveInterval=30 -o ServerAliveCountMax=5" } } {% endif %} {% endfor %}