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

48 lines
1.5 KiB
YAML

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