cleanup and add code block
This commit is contained in:
parent
e7e90aaaf5
commit
684c1bef51
@ -12,9 +12,6 @@
|
||||
- name: Cleanup from any previous executions
|
||||
ansible.builtin.import_tasks: tasks/cleanup.yml
|
||||
|
||||
- name: Ensure service facts are available
|
||||
ansible.builtin.service_facts:
|
||||
|
||||
- name: Check for services that require being disabled
|
||||
ansible.builtin.import_tasks: tasks/check_services.yml
|
||||
|
||||
|
@ -1,4 +1,7 @@
|
||||
---
|
||||
- name: Ensure service facts are available
|
||||
ansible.builtin.service_facts:
|
||||
|
||||
- name: Capture a list of running services
|
||||
ansible.builtin.set_fact:
|
||||
bigboot_systemd_running_services:
|
||||
@ -33,21 +36,21 @@
|
||||
bigboot_services_disabled: "{{ bigboot_services_disabled | default([]) + [item] }}"
|
||||
loop: "{{ bigboot_incompatible_services }}"
|
||||
when:
|
||||
- item not in bigboot_protected_services
|
||||
- ansible_facts['services'][item] is defined
|
||||
- ansible_facts['services'][item]['state'] == "running"
|
||||
|
||||
- name: Log and disable services
|
||||
ansible.builtin.include_tasks: tasks/disable_systemd_services.yml
|
||||
loop: "{{ bigboot_services_disabled }}"
|
||||
when:
|
||||
- bigboot_services_disabled is defined
|
||||
- bigboot_services_disabled | length > 0
|
||||
block:
|
||||
- name: Disable services and log their state
|
||||
ansible.builtin.include_tasks: tasks/disable_systemd_services.yml
|
||||
loop: "{{ bigboot_services_disabled }}"
|
||||
|
||||
- name: Services disabled notice
|
||||
- name: Services disabled notice
|
||||
ansible.builtin.debug:
|
||||
msg: >-
|
||||
The following services were disabled, and will be re-enabled post
|
||||
Bigboot execution: {{ bigboot_services_disabled | join(', ') }}
|
||||
when:
|
||||
- bigboot_services_disabled is defined
|
||||
- bigboot_services_disabled | length > 0
|
||||
|
||||
|
@ -8,14 +8,6 @@ bigboot_reboot_timeout: 1800
|
||||
|
||||
bigboot_skip_rear_backup: false
|
||||
|
||||
bigboot_docker_service: docker.service
|
||||
bigboot_docker_running: stopped
|
||||
bigboot_docker_enabled: false
|
||||
|
||||
bigboot_named_chroot_service: named-chroot.service
|
||||
bigboot_named_chroot_running: stopped
|
||||
bigboot_named_chroot_enabled: false
|
||||
|
||||
# Max value in minutes for services timeout threshold:
|
||||
bigboot_service_max_timeout: 5
|
||||
|
||||
@ -29,6 +21,9 @@ bigboot_incompatible_services:
|
||||
|
||||
# List of services which will be excluded from being
|
||||
# disabled during Bigboot execution:
|
||||
#
|
||||
# (Services listed in `bigboot_incompatible_services`
|
||||
# will ALWAYS be disabled regardless if they are protected or not)
|
||||
bigboot_protected_services:
|
||||
- sshd.service
|
||||
- user@0.service
|
||||
@ -36,7 +31,7 @@ bigboot_protected_services:
|
||||
- rhnsd.service
|
||||
- rhnsd
|
||||
- boksm.service
|
||||
# - <add splunk service on wells>
|
||||
- SplunkForwarder.service
|
||||
|
||||
# Filename of disabled services log:
|
||||
bigboot_disabled_services_log: /var/ipe/ipu/el7to8/bigboot_disabled_services.log
|
||||
|
Loading…
x
Reference in New Issue
Block a user