refactor(configuration): add platform_config dict and replace is_rhel/is_debian with os_family lookups
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
---
|
||||
- name: Enable systemd services
|
||||
when: os not in ['alpine', 'void']
|
||||
when: _configuration_platform.init_system == 'systemd'
|
||||
vars:
|
||||
configuration_systemd_services: >-
|
||||
{{
|
||||
['NetworkManager']
|
||||
+ (['firewalld'] if system_cfg.features.firewall.backend == 'firewalld' and system_cfg.features.firewall.enabled | bool else [])
|
||||
+ (['ufw'] if system_cfg.features.firewall.backend == 'ufw' and system_cfg.features.firewall.enabled | bool else [])
|
||||
+ ([('ssh' if is_debian | bool else 'sshd')] if system_cfg.features.ssh.enabled | bool else [])
|
||||
+ ([_configuration_platform.ssh_service] if system_cfg.features.ssh.enabled | bool else [])
|
||||
+ (['logrotate', 'systemd-timesyncd'] if os == 'archlinux' else [])
|
||||
}}
|
||||
ansible.builtin.command: "{{ chroot_command }} systemctl enable {{ item }}"
|
||||
@@ -16,7 +16,7 @@
|
||||
changed_when: configuration_enable_service_result.rc == 0
|
||||
|
||||
- name: Enable OpenRC services
|
||||
when: os == 'alpine'
|
||||
when: _configuration_platform.init_system == 'openrc'
|
||||
vars:
|
||||
configuration_openrc_services: >-
|
||||
{{
|
||||
@@ -48,7 +48,7 @@
|
||||
when: item.stat.exists
|
||||
|
||||
- name: Enable runit services
|
||||
when: os == 'void'
|
||||
when: _configuration_platform.init_system == 'runit'
|
||||
vars:
|
||||
configuration_runit_services: >-
|
||||
{{
|
||||
|
||||
Reference in New Issue
Block a user