Ensure insist=true is always set for lsyncd

If insist is not set to true then lsyncd will exit if it cannot
perform an initial rsync to the target hosts.

Due to the order in which the repo servers are configured, lsyncd
may be installed and started on the first host in the repo_servers
group before the ssh keys and other necessary configuration have
been placed on the remaining hosts. This leads to a failure to
start lsyncd.

This patch moves the setting of insist into the lua config file
for all operating systems, and removes the need to template a
defaults file on debian derivatives.

Change-Id: I26bb0e21d797c2bfbe67e03003da01c355c27561
This commit is contained in:
Jonathan Rosser 2022-02-10 09:41:59 +00:00
parent 0ff7578897
commit ee0a6d5b37
3 changed files with 5 additions and 7 deletions

View File

@ -18,12 +18,13 @@
src: "{{ item.src }}"
dest: "{{ item.dest }}"
with_items:
- { src: "lsyncd.lua.j2", dest: "{{ repo_lsyncd_config_file }}" }
- { src: "lsyncd.defaults.j2", dest: "{{ repo_lsyncd_defaults_file }}" }
- { src: "lsyncd.lua.j2", dest: "{{ repo_lsyncd_config_file }}", condition: true }
- { src: "lsyncd.defaults.j2", dest: "{{ repo_lsyncd_defaults_file }}", condition: "{{ ansible_facts['pkg_mgr'] == 'dnf' }}" }
notify:
- reload lsyncd
when:
- groups['repo_all'] | length > 1
- item.condition | bool
tags:
- repo-lsyncd
- repo-config

View File

@ -1,5 +1 @@
{% if ansible_facts['os_family'] == 'Debian' %}
DAEMON_ARGS="$DAEMON_ARGS -insist"
{% elif ansible_facts['os_family'] == 'RedHat' %}
LSYNCD_OPTIONS="{{ repo_lsyncd_config_file }}"
{% endif %}

View File

@ -609,7 +609,8 @@ rsync.delay = 15
settings {
logfile = "/var/log/lsyncd/lsyncd.log",
statusFile = "/var/log/lsyncd/lsyncd-status.log",
statusInterval = 20
statusInterval = 20,
insist = true
}
{% for node in groups['repo_all'] %}