Skip to content

Commit

Permalink
Merge pull request #911 from dacook/restart-with-config-changes
Browse files Browse the repository at this point in the history
Restart after config changes
  • Loading branch information
mkllnk authored Apr 23, 2024
2 parents a2bed01 + 6600273 commit fb093d4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions roles/app/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
- { src: "env.j2", dest: "{{ config_path }}/.env.{{ rails_env }}" }
- { src: "postgresql.yml.j2", dest: "{{ config_path }}/database.yml" }
tags: app_templates
notify:
- restart puma
- restart postgres
- restart sidekiq

- name: get l10n repo
git:
Expand Down
13 changes: 13 additions & 0 deletions roles/shared_handlers/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# This role holds reusable handlers that can be included in multiple playbooks to keep things DRY

- name: fetch services status # into the global variable ansible_facts.services
service_facts:
listen: # run if the following tasks have been notified:
- restart sidekiq

- name: restart puma
service:
name: puma
Expand All @@ -13,3 +18,11 @@
state: restarted
become: yes
become_user: root

- name: restart sidekiq
service:
name: sidekiq
state: restarted
become: yes
become_user: root
when: ansible_facts.services['sidekiq.service']['state'] == 'running'

0 comments on commit fb093d4

Please sign in to comment.