diff --git a/confluent_osdeploy/el7/profiles/default/syncfiles b/confluent_osdeploy/el7/profiles/default/syncfiles new file mode 100644 index 00000000..d8283e3e --- /dev/null +++ b/confluent_osdeploy/el7/profiles/default/syncfiles @@ -0,0 +1,13 @@ +# This file lists files to synchronize or merge to the deployed systems from the deployment server +# To specify taking /some/path/hosts on the deploymennt server and duplicating it to /etc/hosts: +# /some/path/hosts -> /etc/hosts + +# If wanting to simply use the same path for source and destinaiton, the -> may be skipped: +# /etc/hosts + +# Entries under MERGE will attempt to be intelligently merged. This supports /etc/group and /etc/passwd +# Any supporting entries in /etc/shadow or /etc/gshadow are added automatically, with password disabled +# It also will not inject 'system' ids (under 1,000 usually) as those tend to be local and rpm managed. +MERGE: +# /etc/passwd +# /etc/group diff --git a/confluent_osdeploy/el8/profiles/default/syncfiles b/confluent_osdeploy/el8/profiles/default/syncfiles new file mode 100644 index 00000000..d8283e3e --- /dev/null +++ b/confluent_osdeploy/el8/profiles/default/syncfiles @@ -0,0 +1,13 @@ +# This file lists files to synchronize or merge to the deployed systems from the deployment server +# To specify taking /some/path/hosts on the deploymennt server and duplicating it to /etc/hosts: +# /some/path/hosts -> /etc/hosts + +# If wanting to simply use the same path for source and destinaiton, the -> may be skipped: +# /etc/hosts + +# Entries under MERGE will attempt to be intelligently merged. This supports /etc/group and /etc/passwd +# Any supporting entries in /etc/shadow or /etc/gshadow are added automatically, with password disabled +# It also will not inject 'system' ids (under 1,000 usually) as those tend to be local and rpm managed. +MERGE: +# /etc/passwd +# /etc/group diff --git a/confluent_server/confluent/syncfiles.py b/confluent_server/confluent/syncfiles.py index 6532ae52..977c4de1 100644 --- a/confluent_server/confluent/syncfiles.py +++ b/confluent_server/confluent/syncfiles.py @@ -69,11 +69,10 @@ class SyncList(object): currmap[k] = v -def sync_list_to_node(synclist, node, suffixes): +def sync_list_to_node(sl, node, suffixes): targdir = tempfile.mkdtemp('.syncto{}'.format(node)) output = '' try: - sl = SyncList(synclist) for ent in sl.replacemap: stage_ent(sl.replacemap, ent, targdir) if 'append' in suffixes: @@ -144,8 +143,11 @@ def start_syncfiles(nodename, cfg, suffixes): synclist = '/var/lib/confluent/public/os/{}/syncfiles'.format(profile) if not os.path.exists(synclist): return '200 OK' # not running + sl = SyncList(synclist) + if not (sl.appendmap or sl.mergemap or sl.replacemap): + return '200 OK' # the synclist has no actual entries syncrunners[nodename] = eventlet.spawn( - sync_list_to_node, synclist, nodename, suffixes) + sync_list_to_node, sl, nodename, suffixes) return '202 Queued' # backgrounded def get_syncresult(nodename):