Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restart after config changes #911

Merged
merged 3 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
Loading