From 8067baeb27d6eed506608345e9b8e80bbfbded53 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sun, 28 Nov 2021 17:04:15 +0100 Subject: [PATCH] remove selinux relabel --- src/rougail/template/systemd.py | 7 +++---- .../01base_file/result/tmpfiles.d/0rougail.conf | 2 -- .../01base_file_include/result/tmpfiles.d/0rougail.conf | 2 -- .../result/tmpfiles.d/0rougail.conf | 2 -- .../result/tmpfiles.d/0rougail.conf | 3 --- .../01base_file_patch/result/tmpfiles.d/0rougail.conf | 2 -- .../01base_file_utfchar/result/tmpfiles.d/0rougail.conf | 2 -- .../result/tmpfiles.d/0rougail.conf | 1 - .../result/tmpfiles.d/0rougail.conf | 1 - .../20notemplating/result/tmpfiles.d/0rougail.conf | 1 - .../40ifin_leadershipauto/result/tmpfiles.d/0rougail.conf | 1 - .../result/tmpfiles.d/0rougail.conf | 2 -- .../45extra_without_family/result/tmpfiles.d/0rougail.conf | 1 - .../60extra_leadership/result/tmpfiles.d/0rougail.conf | 2 -- .../result/tmpfiles.d/0rougail.conf | 2 -- .../result/tmpfiles.d/0rougail.conf | 2 -- .../result/tmpfiles.d/0rougail.conf | 2 -- .../70container_files/result/tmpfiles.d/0rougail.conf | 1 - .../result/tmpfiles.d/0rougail.conf | 4 ---- .../result/tmpfiles.d/0rougail.conf | 4 ---- .../result/tmpfiles.d/0rougail.conf | 1 - 21 files changed, 3 insertions(+), 42 deletions(-) diff --git a/src/rougail/template/systemd.py b/src/rougail/template/systemd.py index 11b985b44..338963e2c 100644 --- a/src/rougail/template/systemd.py +++ b/src/rougail/template/systemd.py @@ -40,12 +40,12 @@ IPAddressDeny=any ROUGAIL_DEST = '/usr/local/lib' ROUGAIL_GLOBAL_SYSTEMD_FILE = '/usr/lib/systemd/system' +ROUGAIL_DEST_FILE = '/tmpfiles.d/0rougail.conf' ROUGAIL_TMPL_TEMPLATE = f"""%def display(%%file, %%filename) %if %%filename.startswith('/etc/') or %%filename.startswith('/var/') or %%filename.startswith('/srv/') C %%filename %%file.mode %%file.owner %%file.group - {ROUGAIL_DEST}%%filename -z %%filename - - - - - %end if %end def %for %%service in %%services @@ -186,13 +186,12 @@ class RougailSystemdTemplate(RougailBaseTemplate): self.ip_per_service = None def post_instance(self): - destfile = '/tmpfiles.d/0rougail.conf' - destfilename = join(self.destinations_dir, destfile[1:]) + destfilename = join(self.destinations_dir, ROUGAIL_DEST_FILE[1:]) makedirs(dirname(destfilename), exist_ok=True) self.log.info(_(f"creole processing: '{destfilename}'")) self.engines['creole'].process(filename=None, source=ROUGAIL_TMPL_TEMPLATE, - true_destfilename=destfile, + true_destfilename=ROUGAIL_DEST_FILE, destfilename=destfilename, destdir=self.destinations_dir, variable=None, diff --git a/tests/dictionaries/01base_file/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/01base_file/result/tmpfiles.d/0rougail.conf index 2dab2179e..8a8e63080 100644 --- a/tests/dictionaries/01base_file/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/01base_file/result/tmpfiles.d/0rougail.conf @@ -1,4 +1,2 @@ C /etc/file 0644 root root - /usr/local/lib/etc/file -z /etc/file - - - - - C /etc/file2 0644 root root - /usr/local/lib/etc/file2 -z /etc/file2 - - - - - diff --git a/tests/dictionaries/01base_file_include/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/01base_file_include/result/tmpfiles.d/0rougail.conf index 2dab2179e..8a8e63080 100644 --- a/tests/dictionaries/01base_file_include/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/01base_file_include/result/tmpfiles.d/0rougail.conf @@ -1,4 +1,2 @@ C /etc/file 0644 root root - /usr/local/lib/etc/file -z /etc/file - - - - - C /etc/file2 0644 root root - /usr/local/lib/etc/file2 -z /etc/file2 - - - - - diff --git a/tests/dictionaries/01base_file_include_content/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/01base_file_include_content/result/tmpfiles.d/0rougail.conf index 2dab2179e..8a8e63080 100644 --- a/tests/dictionaries/01base_file_include_content/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/01base_file_include_content/result/tmpfiles.d/0rougail.conf @@ -1,4 +1,2 @@ C /etc/file 0644 root root - /usr/local/lib/etc/file -z /etc/file - - - - - C /etc/file2 0644 root root - /usr/local/lib/etc/file2 -z /etc/file2 - - - - - diff --git a/tests/dictionaries/01base_file_include_name/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/01base_file_include_name/result/tmpfiles.d/0rougail.conf index 245eb456b..7692f4d54 100644 --- a/tests/dictionaries/01base_file_include_name/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/01base_file_include_name/result/tmpfiles.d/0rougail.conf @@ -1,6 +1,3 @@ C /etc/file 0644 root root - /usr/local/lib/etc/file -z /etc/file - - - - - C /etc/file2 0644 root root - /usr/local/lib/etc/file2 -z /etc/file2 - - - - - C /etc/dir/incfile 0644 root root - /usr/local/lib/etc/dir/incfile -z /etc/dir/incfile - - - - - diff --git a/tests/dictionaries/01base_file_patch/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/01base_file_patch/result/tmpfiles.d/0rougail.conf index 2dab2179e..8a8e63080 100644 --- a/tests/dictionaries/01base_file_patch/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/01base_file_patch/result/tmpfiles.d/0rougail.conf @@ -1,4 +1,2 @@ C /etc/file 0644 root root - /usr/local/lib/etc/file -z /etc/file - - - - - C /etc/file2 0644 root root - /usr/local/lib/etc/file2 -z /etc/file2 - - - - - diff --git a/tests/dictionaries/01base_file_utfchar/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/01base_file_utfchar/result/tmpfiles.d/0rougail.conf index 23f97d816..628620e0e 100644 --- a/tests/dictionaries/01base_file_utfchar/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/01base_file_utfchar/result/tmpfiles.d/0rougail.conf @@ -1,4 +1,2 @@ C /etc/systemd-makefs@dev-disk-by\x2dpartlabel 0644 root root - /usr/local/lib/etc/systemd-makefs@dev-disk-by\x2dpartlabel -z /etc/systemd-makefs@dev-disk-by\x2dpartlabel - - - - - C /etc/systemd-makefs@dev-disk-by\x2dpartlabel2 0644 root root - /usr/local/lib/etc/systemd-makefs@dev-disk-by\x2dpartlabel2 -z /etc/systemd-makefs@dev-disk-by\x2dpartlabel2 - - - - - diff --git a/tests/dictionaries/11disabled_if_in_filelist/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/11disabled_if_in_filelist/result/tmpfiles.d/0rougail.conf index 574c7b823..1bc5dfc34 100644 --- a/tests/dictionaries/11disabled_if_in_filelist/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/11disabled_if_in_filelist/result/tmpfiles.d/0rougail.conf @@ -1,2 +1 @@ C /etc/file 0644 root root - /usr/local/lib/etc/file -z /etc/file - - - - - diff --git a/tests/dictionaries/11disabled_if_in_filelist_same_name/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/11disabled_if_in_filelist_same_name/result/tmpfiles.d/0rougail.conf index 574c7b823..1bc5dfc34 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_same_name/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/11disabled_if_in_filelist_same_name/result/tmpfiles.d/0rougail.conf @@ -1,2 +1 @@ C /etc/file 0644 root root - /usr/local/lib/etc/file -z /etc/file - - - - - diff --git a/tests/dictionaries/20notemplating/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/20notemplating/result/tmpfiles.d/0rougail.conf index 574c7b823..1bc5dfc34 100644 --- a/tests/dictionaries/20notemplating/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/20notemplating/result/tmpfiles.d/0rougail.conf @@ -1,2 +1 @@ C /etc/file 0644 root root - /usr/local/lib/etc/file -z /etc/file - - - - - diff --git a/tests/dictionaries/40ifin_leadershipauto/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/40ifin_leadershipauto/result/tmpfiles.d/0rougail.conf index 46697e03a..1dd254762 100644 --- a/tests/dictionaries/40ifin_leadershipauto/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/40ifin_leadershipauto/result/tmpfiles.d/0rougail.conf @@ -1,2 +1 @@ C /etc/mailname 0644 root root - /usr/local/lib/etc/mailname -z /etc/mailname - - - - - diff --git a/tests/dictionaries/40ifin_leadershipauto_follower/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/40ifin_leadershipauto_follower/result/tmpfiles.d/0rougail.conf index 7a8d00f42..599c6ecb8 100644 --- a/tests/dictionaries/40ifin_leadershipauto_follower/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/40ifin_leadershipauto_follower/result/tmpfiles.d/0rougail.conf @@ -1,4 +1,2 @@ C /etc/mailname 0644 root root - /usr/local/lib/etc/mailname -z /etc/mailname - - - - - C /etc/mailname2 0644 root root - /usr/local/lib/etc/mailname2 -z /etc/mailname2 - - - - - diff --git a/tests/dictionaries/45extra_without_family/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/45extra_without_family/result/tmpfiles.d/0rougail.conf index 574c7b823..1bc5dfc34 100644 --- a/tests/dictionaries/45extra_without_family/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/45extra_without_family/result/tmpfiles.d/0rougail.conf @@ -1,2 +1 @@ C /etc/file 0644 root root - /usr/local/lib/etc/file -z /etc/file - - - - - diff --git a/tests/dictionaries/60extra_leadership/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/60extra_leadership/result/tmpfiles.d/0rougail.conf index 7a8d00f42..599c6ecb8 100644 --- a/tests/dictionaries/60extra_leadership/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/60extra_leadership/result/tmpfiles.d/0rougail.conf @@ -1,4 +1,2 @@ C /etc/mailname 0644 root root - /usr/local/lib/etc/mailname -z /etc/mailname - - - - - C /etc/mailname2 0644 root root - /usr/local/lib/etc/mailname2 -z /etc/mailname2 - - - - - diff --git a/tests/dictionaries/60extra_leadership_name/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/60extra_leadership_name/result/tmpfiles.d/0rougail.conf index 7a8d00f42..599c6ecb8 100644 --- a/tests/dictionaries/60extra_leadership_name/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/60extra_leadership_name/result/tmpfiles.d/0rougail.conf @@ -1,4 +1,2 @@ C /etc/mailname 0644 root root - /usr/local/lib/etc/mailname -z /etc/mailname - - - - - C /etc/mailname2 0644 root root - /usr/local/lib/etc/mailname2 -z /etc/mailname2 - - - - - diff --git a/tests/dictionaries/60extra_leadership_name_item/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/60extra_leadership_name_item/result/tmpfiles.d/0rougail.conf index 7a8d00f42..599c6ecb8 100644 --- a/tests/dictionaries/60extra_leadership_name_item/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/60extra_leadership_name_item/result/tmpfiles.d/0rougail.conf @@ -1,4 +1,2 @@ C /etc/mailname 0644 root root - /usr/local/lib/etc/mailname -z /etc/mailname - - - - - C /etc/mailname2 0644 root root - /usr/local/lib/etc/mailname2 -z /etc/mailname2 - - - - - diff --git a/tests/dictionaries/60extra_leadership_valid_enum/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/60extra_leadership_valid_enum/result/tmpfiles.d/0rougail.conf index 7a8d00f42..599c6ecb8 100644 --- a/tests/dictionaries/60extra_leadership_valid_enum/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/60extra_leadership_valid_enum/result/tmpfiles.d/0rougail.conf @@ -1,4 +1,2 @@ C /etc/mailname 0644 root root - /usr/local/lib/etc/mailname -z /etc/mailname - - - - - C /etc/mailname2 0644 root root - /usr/local/lib/etc/mailname2 -z /etc/mailname2 - - - - - diff --git a/tests/dictionaries/70container_files/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/70container_files/result/tmpfiles.d/0rougail.conf index 46697e03a..1dd254762 100644 --- a/tests/dictionaries/70container_files/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/70container_files/result/tmpfiles.d/0rougail.conf @@ -1,2 +1 @@ C /etc/mailname 0644 root root - /usr/local/lib/etc/mailname -z /etc/mailname - - - - - diff --git a/tests/dictionaries/70container_files_symlink_multi/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/70container_files_symlink_multi/result/tmpfiles.d/0rougail.conf index 95445abe3..82371221b 100644 --- a/tests/dictionaries/70container_files_symlink_multi/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/70container_files_symlink_multi/result/tmpfiles.d/0rougail.conf @@ -1,8 +1,4 @@ C /etc/mailname 0644 root root - /usr/local/lib/etc/mailname -z /etc/mailname - - - - - C /etc/mailname2 0644 root root - /usr/local/lib/etc/mailname2 -z /etc/mailname2 - - - - - C /etc/mailname3 0644 root root - /usr/local/lib/etc/mailname3 -z /etc/mailname3 - - - - - C /etc/mailname4 0644 root root - /usr/local/lib/etc/mailname4 -z /etc/mailname4 - - - - - diff --git a/tests/dictionaries/70container_files_symlink_multi_variable/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/70container_files_symlink_multi_variable/result/tmpfiles.d/0rougail.conf index 95445abe3..82371221b 100644 --- a/tests/dictionaries/70container_files_symlink_multi_variable/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/70container_files_symlink_multi_variable/result/tmpfiles.d/0rougail.conf @@ -1,8 +1,4 @@ C /etc/mailname 0644 root root - /usr/local/lib/etc/mailname -z /etc/mailname - - - - - C /etc/mailname2 0644 root root - /usr/local/lib/etc/mailname2 -z /etc/mailname2 - - - - - C /etc/mailname3 0644 root root - /usr/local/lib/etc/mailname3 -z /etc/mailname3 - - - - - C /etc/mailname4 0644 root root - /usr/local/lib/etc/mailname4 -z /etc/mailname4 - - - - - diff --git a/tests/dictionaries/70container_files_symlink_variable/result/tmpfiles.d/0rougail.conf b/tests/dictionaries/70container_files_symlink_variable/result/tmpfiles.d/0rougail.conf index 46697e03a..1dd254762 100644 --- a/tests/dictionaries/70container_files_symlink_variable/result/tmpfiles.d/0rougail.conf +++ b/tests/dictionaries/70container_files_symlink_variable/result/tmpfiles.d/0rougail.conf @@ -1,2 +1 @@ C /etc/mailname 0644 root root - /usr/local/lib/etc/mailname -z /etc/mailname - - - - -