~xenrox/ansible

ad7b407172f158303c9eee137a8a1a256fa15604 — Thorben Günther 2 years ago 50d0a54
setup_archlinux: Install timer to reboot system
A roles/setup_archlinux/files/reboot.service => roles/setup_archlinux/files/reboot.service +6 -0
@@ 0,0 1,6 @@
[Unit]
Description=System reboot

[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl reboot

A roles/setup_archlinux/files/reboot.timer => roles/setup_archlinux/files/reboot.timer +8 -0
@@ 0,0 1,8 @@
[Unit]
Description=System reboot timer

[Timer]
OnCalendar=Mon *-*-* 05:30:00

[Install]
WantedBy=timers.target

M roles/setup_archlinux/tasks/main.yml => roles/setup_archlinux/tasks/main.yml +18 -0
@@ 9,3 9,21 @@
    name: systemd-timesyncd
    enabled: true
    state: started

- 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