Support for logging of disabled services
This commit is contained in:
parent
f655d19716
commit
664291b15d
@ -29,3 +29,11 @@
|
|||||||
when:
|
when:
|
||||||
- item['item'] not in bigboot_protected_services
|
- item['item'] not in bigboot_protected_services
|
||||||
- item['stdout'] | regex_replace('^.*=(.*$)', '\\1') | community.general.to_minutes > bigboot_service_max_timeout
|
- item['stdout'] | regex_replace('^.*=(.*$)', '\\1') | community.general.to_minutes > bigboot_service_max_timeout
|
||||||
|
|
||||||
|
- name: Log list of disabled services
|
||||||
|
ansible.builtin.copy:
|
||||||
|
content: "{{ bigboot_systemd_disabled_services }}"
|
||||||
|
dest: "{{ bigboot_disabled_services_log }}"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0600"
|
||||||
|
@ -29,4 +29,16 @@
|
|||||||
path: "/boot/initramfs-{{ initramfs_kernel_version }}.img.{{ initramfs_backup_extension }}"
|
path: "/boot/initramfs-{{ initramfs_kernel_version }}.img.{{ initramfs_backup_extension }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
|
- name: Check if disable services log exists
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: "{{ bigboot_disabled_services_log }}"
|
||||||
|
register: bigboot_disabled_services_log_stat
|
||||||
|
|
||||||
|
- name: Remove disabled services log if present
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ bigboot_disabled_services_log }}"
|
||||||
|
state: absent
|
||||||
|
when:
|
||||||
|
- bigboot_disabled_services_log_stat['stat']['exists'] | bool
|
||||||
|
|
||||||
...
|
...
|
||||||
|
@ -9,3 +9,13 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
bigboot_systemd_disabled_services:
|
bigboot_systemd_disabled_services:
|
||||||
"{{ bigboot_systemd_disabled_services | default([]) + [item['item']] }}"
|
"{{ bigboot_systemd_disabled_services | default([]) + [item['item']] }}"
|
||||||
|
|
||||||
|
- name: Log disabled service to log file
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
path: "{{ bigboot_disabled_services_log }}"
|
||||||
|
line: "{{ item }}"
|
||||||
|
create: true
|
||||||
|
state: present
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0600"
|
||||||
|
@ -22,3 +22,6 @@ bigboot_protected_services:
|
|||||||
- rhnsd.service
|
- rhnsd.service
|
||||||
- rhnsd
|
- rhnsd
|
||||||
- boksm.service
|
- boksm.service
|
||||||
|
|
||||||
|
# Filename of disabled services log:
|
||||||
|
bigboot_disabled_services_log: /var/ipe/ipu/bigboot-disabled-services
|
||||||
|
Loading…
x
Reference in New Issue
Block a user