Skip to content

Commit

Permalink
Merge pull request #178 from guerler/gravity_update
Browse files Browse the repository at this point in the history
Adjust for recent gravity changes
  • Loading branch information
mvdbeek committed Feb 14, 2023
2 parents 65c1f01 + 8183b79 commit 127ce63
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/molecule.yml
Expand Up @@ -25,6 +25,7 @@ jobs:
- '21.01'
- '22.01'
- '22.05'
- 'dev'
exclude:
# wheels often don't exist in the combination of old package versions in older galaxy releases for newer
# python versions in newer operating systems; nobody should be installing an old galaxy on a new os anyway, so
Expand Down
14 changes: 14 additions & 0 deletions handlers/gravity_22.05.yml
@@ -0,0 +1,14 @@
---
# handlers for gravity as used in galaxy version 22.05

- name: galaxy gravity restart
command: "{{ galaxy_venv_dir }}/bin/galaxyctl graceful"
environment:
GRAVITY_STATE_DIR: "{{ galaxy_gravity_state_dir }}"
listen: "restart galaxy"

- name: galaxyctl update
command: "{{ galaxy_venv_dir }}/bin/galaxyctl update"
environment:
GRAVITY_STATE_DIR: "{{ galaxy_gravity_state_dir }}"
listen: "galaxyctl update"
18 changes: 18 additions & 0 deletions handlers/gravity_23.0.yml
@@ -0,0 +1,18 @@
---
# handlers for gravity as used in galaxy version 23.0

- name: galaxy gravity restart
command: "{{ galaxy_venv_dir }}/bin/galaxyctl -c {{ galaxy_config_file }} graceful"
environment:
GRAVITY_STATE_DIR: "{{ galaxy_gravity_state_dir }}"
listen: "restart galaxy"
become: yes
become_user: "{{ __galaxy_user_name }}"

- name: galaxyctl update
command: "{{ galaxy_venv_dir }}/bin/galaxyctl -c {{ galaxy_config_file }} update"
environment:
GRAVITY_STATE_DIR: "{{ galaxy_gravity_state_dir }}"
listen: "galaxyctl update"
become: yes
become_user: "{{ __galaxy_user_name }}"
19 changes: 8 additions & 11 deletions handlers/main.yml
Expand Up @@ -22,15 +22,12 @@
when: "galaxy_systemd_mode == 'mule' and galaxy_manage_systemd"
listen: "restart galaxy"

- name: galaxy gravity restart
command: "{{ galaxy_venv_dir }}/bin/galaxyctl graceful"
environment:
GRAVITY_STATE_DIR: "{{ galaxy_gravity_state_dir }}"
when: "galaxy_systemd_mode == 'gravity' and galaxy_manage_systemd"
listen: "restart galaxy"
- name: Include Gravity handlers (for 22.05)
import_tasks:
file: gravity_22.05.yml
when: "galaxy_systemd_mode == 'gravity' and galaxy_manage_systemd and __galaxy_major_version is version('23.0', '<')"

- name: galaxyctl update
command: "{{ galaxy_venv_dir }}/bin/galaxyctl update"
environment:
GRAVITY_STATE_DIR: "{{ galaxy_gravity_state_dir }}"
when: "galaxy_systemd_mode == 'gravity'"
- name: Include Gravity handlers (for 23.0)
import_tasks:
file: gravity_23.0.yml
when: "galaxy_systemd_mode == 'gravity' and galaxy_manage_systemd and __galaxy_major_version is version('23.0', '>=')"
8 changes: 8 additions & 0 deletions tasks/gravity.yml
Expand Up @@ -8,11 +8,19 @@
command: "{{ galaxy_venv_dir }}/bin/galaxyctl register {{ galaxy_config_file }}"
args:
creates: "{{ galaxy_gravity_state_dir }}/configstate.yaml"
when: __galaxy_major_version is version('23.0', '<')

- name: Update Gravity process management files
command: "{{ galaxy_venv_dir }}/bin/galaxyctl update"
args:
creates: "{{ galaxy_gravity_state_dir }}/supervisor/supervisord.conf.d"
when: __galaxy_major_version is version('23.0', '<')

- name: Update Gravity process management files
command: "{{ galaxy_venv_dir }}/bin/galaxyctl -c {{ galaxy_config_file }} update"
args:
creates: "{{ galaxy_gravity_state_dir }}/supervisor/supervisord.conf.d"
when: __galaxy_major_version is version('23.0', '>=')

environment:
GRAVITY_STATE_DIR: "{{ galaxy_gravity_state_dir }}"
Expand Down

0 comments on commit 127ce63

Please sign in to comment.