Skip to content

Commit

Permalink
🚸 Call handlers on changes instead of reloading every time
Browse files Browse the repository at this point in the history
This is between bug and QoL:
* Do not restart the services when nothing happened.
* Molecule tests would consider this a failure because a role is expected to converge.
  • Loading branch information
penguineer committed Jul 24, 2022
1 parent 8c9aa41 commit 5ab04f0
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
owner: root
group: root
mode: '0644'
notify: Force systemd to reread configs

- name: Copy gen_coin executable
ansible.builtin.copy:
Expand All @@ -45,6 +46,7 @@
owner: "{{ ble_keykeeper_user }}"
group: "{{ ble_keykeeper_group }}"
mode: '0744'
notify: Restart ble-keykeeper service

- name: Template service file
ansible.builtin.template:
Expand All @@ -53,6 +55,7 @@
owner: "{{ ble_keykeeper_user }}"
group: "{{ ble_keykeeper_group }}"
mode: '0644'
notify: Restart ble-keykeeper service

- name: Make sure pip3 is installed
apt:
Expand All @@ -64,13 +67,4 @@
- name: Install python requirements
pip:
requirements: "{{ble_keykeeper_dir}}/requirements.txt"

- name: Just force systemd to reread configs
ansible.builtin.systemd:
daemon_reload: yes

- name: Restart ble-keykeeper service
ansible.builtin.systemd:
state: restarted
name: ble-keykeeper
enabled: yes
notify: Restart ble-keykeeper service

0 comments on commit 5ab04f0

Please sign in to comment.