From 709714db044de53103d5797a6541cc5e1f336e55 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 29 Aug 2022 06:50:49 -0500 Subject: [PATCH] Add ACPI to Linux servers. Turnkey doesn't have it enabled by default. --- facts/general/service.yml | 8 ++------ facts/server/system.yml | 7 ++----- local.yml | 2 ++ tasks/server/software/services.yml | 20 ++++++++++++++++++++ 4 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 tasks/server/software/services.yml diff --git a/facts/general/service.yml b/facts/general/service.yml index bc8d4eb..a32d7ee 100644 --- a/facts/general/service.yml +++ b/facts/general/service.yml @@ -12,12 +12,8 @@ sshd_config: /etc/ssh/sshd_config crond: cron crond_pattern: cron - - -#- name: General | Facts | Service | Linux -# set_fact: -# when: ansible_system == "Linux" - + acpi: acpid + acpi_pattern: acpid - name: General | Facts | Service | Linux set_fact: diff --git a/facts/server/system.yml b/facts/server/system.yml index d8c88f3..e35f098 100644 --- a/facts/server/system.yml +++ b/facts/server/system.yml @@ -1,10 +1,7 @@ --- -# Network related variables. +# System related variables. -#- name: Facts | Server | System | Not Used Yet -# set_fact: - -- name: Workstation | Facts | Package | FreeBSD +- name: Facts | Server | System | FreeBSD set_fact: ansible_python_interpreter: "/usr/local/bin/python3.8" when: ansible_system == "FreeBSD" diff --git a/local.yml b/local.yml index ba63fc4..7ab6461 100644 --- a/local.yml +++ b/local.yml @@ -144,6 +144,8 @@ - name: Main | Server Setup block: + - include: tasks/server/software/services.yml + - include: tasks/server/software/certbot.yml when: certbot == true - include: tasks/server/cron/certbot.yml diff --git a/tasks/server/software/services.yml b/tasks/server/software/services.yml new file mode 100644 index 0000000..895a605 --- /dev/null +++ b/tasks/server/software/services.yml @@ -0,0 +1,20 @@ +--- +# Enable and disable services. + +## ACPID ## + +- name: Server | Software | Services | ACPID | Install + package: + name: "{{ acpi }}" + state: present + when: ansible_system == "Linux" + ignore_errors: yes + +- name: Server | Software | Services | ACPID | Enable + service: + name: "{{ acpi }}" + pattern: "{{ acpi_pattern }}" + state: started + enabled: yes + when: ansible_system == "Linux" + ignore_errors: yes