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

🐛 FIX: rabbitmq shutdown for systemd #61

Merged
merged 1 commit into from
Dec 3, 2020
Merged
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
24 changes: 17 additions & 7 deletions tasks/aiida-prepare.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
- block:
- name: Start services for systemd
when: ansible_service_mgr == "systemd"
block:
- name: Start Postgresql service
become: true
become_user: "{{ root_user }}"
service:
name: "postgresql"
state: "started"
enabled: true

# see https://github.com/marvel-nccr/quantum-mobile/issues/111
- name: Ensure correct RabbitMQ shutdown
become: true
become_user: "{{ root_user }}"
lineinfile:
path: /lib/systemd/system/rabbitmq-server.service
regexp: ExecStop=/usr/sbin/rabbitmqctl stop
line: ExecStop=/usr/sbin/rabbitmqctl shutdown
- name: Start RabbitMQ service
become: true
become_user: "{{ root_user }}"
service:
name: "rabbitmq-server"
state: "started"
enabled: true
when: ansible_service_mgr == "systemd"

- block:
- name: Check Postgresql
when: ansible_service_mgr != "systemd"
block:
- name: Check if Postgresql is running
shell: pgrep postgres
changed_when: false
Expand All @@ -25,9 +35,10 @@
become: true
become_user: "{{ aiida_postgres_user }}"
command: "{{ aiida_postgres_bin_location }}/pg_ctl start -D {{ aiida_postgres_data_location }} -s -o '-p 5432' -w -t 300"
when: ansible_service_mgr != "systemd"

- block:
- name: Check RabbitMQ
when: ansible_service_mgr != "systemd"
block:
- name: Check if RabbitMQ is running
shell: pgrep rabbitmq
changed_when: false
Expand All @@ -36,7 +47,6 @@
become: true
become_user: "{{ root_user }}"
shell: rabbitmq-server > /dev/null 2>&1 &
when: ansible_service_mgr != "systemd"

- name: Setup postgres db
become: true
Expand Down