From a1060ec14b9dd77f44e4c614eba350f6015c03db Mon Sep 17 00:00:00 2001 From: Someone Date: Fri, 4 Oct 2024 13:42:33 +0200 Subject: [PATCH] [roles/base/systemd/preset] configure systemd-presets --- .../default/99-somesible-defaults.preset | 36 +++++++++++++++++++ roles/base/systemd/preset/tasks/main.yml | 30 ++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 roles/base/systemd/preset/files/default/99-somesible-defaults.preset create mode 100644 roles/base/systemd/preset/tasks/main.yml diff --git a/roles/base/systemd/preset/files/default/99-somesible-defaults.preset b/roles/base/systemd/preset/files/default/99-somesible-defaults.preset new file mode 100644 index 0000000..f5374c9 --- /dev/null +++ b/roles/base/systemd/preset/files/default/99-somesible-defaults.preset @@ -0,0 +1,36 @@ +# +################################################ +### Managed by someone's ansible provisioner ### +################################################ +# Part of: https://git.somenet.org/root/pub/somesible.git +# 2017-2024 by someone +# + +# was enabled before, seems important, keep enabled by default for now, but consider getting rid of/moving to own roles. +enable accounts-daemon.service +enable avahi-daemon.* +enable bluetooth.service +enable cups.* +enable NetworkManager* +enable openvpn.service +enable wpa_supplicant.service + + +# core stuff we likely want. +enable anacron.* +enable apparmor.service +enable blk-availability.service +enable console-setup.service +enable cron.service +enable dm-event.socket +enable keyboard-setup.service +enable lvm2-lvmpolld.socket +enable lvm2-monitor.service +enable man-db.timer +enable mdadm-shutdown.service +enable networking.service +enable rsyslog.service + + +# disable other newly installed services. +disable * diff --git a/roles/base/systemd/preset/tasks/main.yml b/roles/base/systemd/preset/tasks/main.yml new file mode 100644 index 0000000..3c0fc7c --- /dev/null +++ b/roles/base/systemd/preset/tasks/main.yml @@ -0,0 +1,30 @@ +##################################### +### someone's ansible provisioner ### +##################################### +# Part of: https://git.somenet.org/root/pub/somesible.git +# 2017-2024 by someone +# +--- +- name: make sure /etc/systemd/system-preset/ exists + file: + path: "/etc/systemd/system-preset/" + state: directory + mode: 0755 + owner: "root" + group: "root" + + +- name: copy 99-somesible-defaults.preset + copy: + src: "{{item}}" + dest: "/etc/systemd/system-preset/99-somesible-defaults.preset" + with_first_found: + - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/99-somesible-defaults.preset" + - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/99-somesible-defaults.preset" + - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/99-somesible-defaults.preset" + - "default/99-somesible-defaults.preset" + + +- name: reload systemd + systemd: + daemon_reload: yes -- 2.43.0