aboutsummaryrefslogtreecommitdiffstats
path: root/roles/fedora/tasks/systemd.yml
blob: 9fb6221ab0122dbab4dfff80d319133ca250e1f9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
- name: Configure systemd system.conf
  vars:
    systemd_conf: '{{ systemd_conf_default|combine(systemd_conf_role) }}'
  ini_file:
    path: '/etc/systemd/system.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: '{{ systemd_conf }}'

- name: Configure journald.conf
  vars:
    journald_conf: '{{ journald_conf_default|combine(journald_conf_role) }}'
  ini_file:
    path: '/etc/systemd/journald.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: '{{ 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) }}'
  ini_file:
    path: '/etc/systemd/logind.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: '{{ 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: