aboutsummaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorEmil Renner Berthing <esmil@labitat.dk>2021-01-14 17:15:12 +0100
committerEmil Renner Berthing <esmil@labitat.dk>2021-01-16 23:40:05 +0100
commit09f530b0ba699df647e7f20b1936edc700694e55 (patch)
tree97e79c58c764395427119066bbfc9e3ece856040 /roles
parent40d474c5eba4b2fe9ebc7676dfe1b20818a95d2d (diff)
downloadlabitat-ansible-09f530b0ba699df647e7f20b1936edc700694e55.tar.gz
labitat-ansible-09f530b0ba699df647e7f20b1936edc700694e55.tar.xz
labitat-ansible-09f530b0ba699df647e7f20b1936edc700694e55.zip
fedora: systemd: configure sleep.conf and user.conf
Diffstat (limited to 'roles')
-rw-r--r--roles/fedora/defaults/main.yml6
-rw-r--r--roles/fedora/tasks/systemd.yml24
2 files changed, 30 insertions, 0 deletions
diff --git a/roles/fedora/defaults/main.yml b/roles/fedora/defaults/main.yml
index 7ba53a1..858ef41 100644
--- a/roles/fedora/defaults/main.yml
+++ b/roles/fedora/defaults/main.yml
@@ -12,9 +12,15 @@ systemd_conf_role: {}
journald_conf_default: {}
journald_conf_role: {}
+sleep_conf_default: {}
+sleep_conf_role: {}
+
logind_conf_default: {}
logind_conf_role: {}
+user_conf_default: {}
+user_conf_role: {}
+
resolved_conf_default: {}
resolved_conf_role: {}
diff --git a/roles/fedora/tasks/systemd.yml b/roles/fedora/tasks/systemd.yml
index 5413266..9fb6221 100644
--- a/roles/fedora/tasks/systemd.yml
+++ b/roles/fedora/tasks/systemd.yml
@@ -23,6 +23,18 @@
state: "{{ (item.value is string)|ternary('present','absent') }}"
with_dict: '{{ journald_conf }}'
+- name: Configure sleep.conf
+ vars:
+ sleep_conf: '{{ sleep_conf_default|combine(sleep_conf_role) }}'
+ ini_file:
+ path: '/etc/systemd/sleep.conf'
+ no_extra_spaces: yes
+ section: "{{ item.key.split('.',1)[0] }}"
+ option: "{{ item.key.split('.',1)[1] }}"
+ value: "{{ (item.value is string)|ternary(item.value,omit) }}"
+ state: "{{ (item.value is string)|ternary('present','absent') }}"
+ with_dict: '{{ sleep_conf }}'
+
- name: Configure logind.conf
vars:
logind_conf: '{{ logind_conf_default|combine(logind_conf_role) }}'
@@ -35,4 +47,16 @@
state: "{{ (item.value is string)|ternary('present','absent') }}"
with_dict: '{{ logind_conf }}'
+- name: Configure user.conf
+ vars:
+ user_conf: '{{ user_conf_default|combine(user_conf_role) }}'
+ ini_file:
+ path: '/etc/systemd/user.conf'
+ no_extra_spaces: yes
+ section: "{{ item.key.split('.',1)[0] }}"
+ option: "{{ item.key.split('.',1)[1] }}"
+ value: "{{ (item.value is string)|ternary(item.value,omit) }}"
+ state: "{{ (item.value is string)|ternary('present','absent') }}"
+ with_dict: '{{ user_conf }}'
+
# vim: set ts=2 sw=2 et: