~xenrox/ansible

ref: 9d498636a95fce15d713e1be71155415acae60d3 ansible/roles/setup_archlinux/tasks/main.yml -rw-r--r-- 1.5 KiB
9d498636Thorben Günther borg: Improve backup script 2 months ago
                                                                                
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
63
64
65
66
67
68
69
70
71
---
- name: Install useful tools
  community.general.pacman:
    name: "{{ archlinux_packages }}"
    state: present

- name: Set hostname
  ansible.builtin.hostname:
    name: "{{ hostname | default(inventory_hostname) }}"

- name: Start and enable systemd-timesyncd
  ansible.builtin.systemd:
    name: systemd-timesyncd
    enabled: true
    state: started

- name: Symlink resolv.conf
  ansible.builtin.file:
    src: /run/systemd/resolve/stub-resolv.conf
    dest: /etc/resolv.conf
    state: link
    force: true
    follow: false
    owner: root
    group: root
  when: molecule_run is not defined

- name: Install reboot service
  ansible.builtin.copy:
    src: "{{ item }}"
    dest: "/etc/systemd/system/{{ item }}"
    owner: root
    group: root
    mode: 0644
  with_items:
    - reboot.service
    - reboot.timer

- name: Enable reboot timer
  ansible.builtin.systemd:
    name: reboot.timer
    enabled: true
    state: started
    daemon_reload: true

- name: Create journald override path
  ansible.builtin.file:
    path: /etc/systemd/journald.conf.d
    state: directory
    owner: root
    group: root
    mode: 0755

- name: Install journald override file
  ansible.builtin.copy:
    src: journald.conf
    dest: /etc/systemd/journald.conf.d/override.conf
    owner: root
    group: root
    mode: 0644

- name: Install logrotate
  community.general.pacman:
    name: logrotate
    state: present

- name: Start and enable logrotate timer
  ansible.builtin.systemd:
    name: logrotate.timer
    enabled: true
    state: started