Skip to content

Commit

Permalink
Merge pull request #7 from netz39/limit-restarts
Browse files Browse the repository at this point in the history
🐛 Restart services only when changes were made
  • Loading branch information
penguineer authored Jul 29, 2022
2 parents 7d6eb59 + 5ab04f0 commit bb761c9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
9 changes: 9 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- name: 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
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 bb761c9

Please sign in to comment.