dotfiles/config/automatrop/roles/system/handlers/main.yaml

48 lines
1.5 KiB
YAML
Raw Permalink Normal View History

2023-11-02 19:51:54 +01:00
---
- name: Create a etckeeper commit
2023-11-02 19:51:54 +01:00
ansible.builtin.command: etckeeper commit 'automatrop {{ ansible_date_time.iso8601 }}'
listen: etc changed
become: true
2021-06-17 21:21:34 +02:00
register: etckeeper_commit
2023-11-02 19:51:54 +01:00
failed_when: etckeeper_commit.rc != 0 and 'nothing to commit' not in etckeeper_commit.stdout
2021-06-17 21:21:34 +02:00
changed_when: "'nothing to commit' not in etckeeper_commit.stdout"
- name: Restart chrony
2023-11-02 19:51:54 +01:00
ansible.builtin.systemd:
name: chronyd
state: restarted
listen: chrony reconfigured
2023-11-02 19:51:54 +01:00
become: true
- name: Reload systemd daemon
2023-11-02 19:51:54 +01:00
ansible.builtin.systemd:
daemon_reload: true
listen: systemd changed
2023-11-02 19:51:54 +01:00
become: true
- name: Restart wpa_supplicant
2023-11-02 19:51:54 +01:00
ansible.builtin.systemd:
name: wpa_supplicant@{{ item }}
state: restarted
2023-11-02 19:51:54 +01:00
become: true
loop: "{{ ansible_interfaces }}"
2023-11-02 19:51:54 +01:00
when: item.startswith('wl')
listen: wpa_supplicant changed
# Could probably use something better like
# listing /sys/class/ieee80211/*/device/net/
2021-06-17 21:21:34 +02:00
- name: Warn about changed Wi-Fi setup
2023-11-02 19:51:54 +01:00
ansible.builtin.debug:
msg: The Wi-Fi configuration was changed, but not applied to let this playbook finish. A reboot is required.
2021-06-17 21:21:34 +02:00
listen: wifi setup changed
2021-06-21 22:01:48 +02:00
- name: Warn about changed Panfrost config
2023-11-02 19:51:54 +01:00
ansible.builtin.debug:
msg: The Panfrost display driver configuration was changed, but needs a reboot to be applied.
2021-06-21 22:01:48 +02:00
listen: panfrost config changed
- name: Reload systemd-logind
2023-11-02 19:51:54 +01:00
ansible.builtin.command: systemctl kill -s HUP systemd-logind
become: true
listen: systemd-logind config changed