From 249b8b9efec0fe8afc66c1b1071563913526e41c Mon Sep 17 00:00:00 2001 From: Marcus Burghardt Date: Mon, 5 Jun 2023 09:07:29 +0200 Subject: [PATCH 1/3] Minor fixes only related to style --- shared/templates/service_disabled/ansible.template | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/shared/templates/service_disabled/ansible.template b/shared/templates/service_disabled/ansible.template index 9edf1b40408..12052a27541 100644 --- a/shared/templates/service_disabled/ansible.template +++ b/shared/templates/service_disabled/ansible.template @@ -13,13 +13,13 @@ failed_when: service_exists.rc not in [0, 1] check_mode: false -- name: '{{{ rule_title }}} - Ensure "{{{ DAEMONNAME }}}.service" is Masked' +- name: "{{{ rule_title }}} - Ensure {{{ DAEMONNAME }}}.service is Masked" ansible.builtin.systemd: name: "{{{ DAEMONNAME }}}.service" state: "stopped" enabled: false masked: true - when: 'service_exists.stdout_lines is search("{{{ SERVICENAME }}}.service",multiline=True)' + when: 'service_exists.stdout_lines is search("{{{ SERVICENAME }}}.service", multiline=True)' - name: "Unit Socket Exists - {{{ DAEMONNAME }}}.socket" ansible.builtin.command: systemctl -q list-unit-files {{{ DAEMONNAME }}}.socket @@ -28,13 +28,13 @@ failed_when: socket_file_exists.rc not in [0, 1] check_mode: false -- name: Disable socket {{{ SERVICENAME }}} +- name: "Disable Socket {{{ SERVICENAME }}}" ansible.builtin.systemd: name: "{{{ DAEMONNAME }}}.socket" - enabled: "no" + enabled: false state: "stopped" - masked: "yes" - when: 'socket_file_exists.stdout_lines is search("{{{ DAEMONNAME }}}.socket",multiline=True)' + masked: true + when: 'socket_file_exists.stdout_lines is search("{{{ DAEMONNAME }}}.socket", multiline=True)' {{%- else %}} JINJA TEMPLATE ERROR: Unknown init system '{{{ init_system }}}' {{%- endif %}} From 2c9e0b777247840bbe8f5ebfdece8541b2eab487 Mon Sep 17 00:00:00 2001 From: Marcus Burghardt Date: Tue, 7 May 2024 20:55:58 +0200 Subject: [PATCH 2/3] Similar style fixes also for service_enabled --- shared/templates/service_enabled/ansible.template | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/shared/templates/service_enabled/ansible.template b/shared/templates/service_enabled/ansible.template index 7ce0555a602..fcac6191af6 100644 --- a/shared/templates/service_enabled/ansible.template +++ b/shared/templates/service_enabled/ansible.template @@ -3,19 +3,19 @@ # strategy = enable # complexity = low # disruption = low -- name: Enable service {{{ SERVICENAME }}} +- name: "{{{ rule_title }}} - Enable service {{{ SERVICENAME }}}" block: - name: Gather the package facts package_facts: manager: auto {{%- if init_system == "systemd" %}} - - name: Enable service {{{ SERVICENAME }}} - systemd: + - name: "{{{ rule_title }}} - Enable Service {{{ SERVICENAME }}}" + ansible.builtin.systemd: name: "{{{ DAEMONNAME }}}" - enabled: "yes" + enabled: true state: "started" - masked: "no" + masked: false when: - '"{{{ PACKAGENAME }}}" in ansible_facts.packages' {{%- else %}} From 9f37e9ada397c5e4cf70fe3148ab7bc53944dc8a Mon Sep 17 00:00:00 2001 From: Marcus Burghardt <2074099+marcusburghardt@users.noreply.github.com> Date: Tue, 7 May 2024 23:06:18 +0200 Subject: [PATCH 3/3] Update shared/templates/service_disabled/ansible.template Co-authored-by: Matthew Burket --- shared/templates/service_disabled/ansible.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/templates/service_disabled/ansible.template b/shared/templates/service_disabled/ansible.template index 12052a27541..4f3d0c8a2d1 100644 --- a/shared/templates/service_disabled/ansible.template +++ b/shared/templates/service_disabled/ansible.template @@ -28,7 +28,7 @@ failed_when: socket_file_exists.rc not in [0, 1] check_mode: false -- name: "Disable Socket {{{ SERVICENAME }}}" +- name: "{{{ rule_title }}} - Disable Socket {{{ SERVICENAME }}}" ansible.builtin.systemd: name: "{{{ DAEMONNAME }}}.socket" enabled: false