diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62b8a09..6aac671 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,10 @@ jobs: ansible_interpreter: /usr/bin/python3 - distro: debian12 ansible_interpreter: /usr/bin/python3 + - distro: centos7 + ansible_interpreter: /usr/bin/python3 + - distro: rockylinux8 + ansible_interpreter: /usr/bin/python3 steps: - uses: actions/checkout@v5 diff --git a/handlers/main.yml b/handlers/main.yml index 58e1572..8619dc9 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,3 +1,10 @@ --- -- name: reload supervisor - command: supervisorctl reload +- name: restart wireguard vpn updater + command: "supervisorctl restart openwisp-flask-vpn-updater-{{ openwisp2_wireguard_vpn_uuid }}" + register: supervisor_restart + failed_when: > + supervisor_restart.rc != 0 and + 'ERROR (no such process)' not in supervisor_restart.stderr + changed_when: > + supervisor_restart.rc == 0 and + 'ERROR (no such process)' not in supervisor_restart.stderr diff --git a/tasks/flask.yml b/tasks/flask.yml index 5979b9a..76e0a93 100644 --- a/tasks/flask.yml +++ b/tasks/flask.yml @@ -14,7 +14,7 @@ group: "{{ openwisp_group }}" mode: 0750 tags: [wireguard, updater_script] - notify: reload supervisor + notify: restart wireguard vpn updater - name: Bring up WireGuard interface on boot block: @@ -63,7 +63,7 @@ mode: 0750 group: "{{ openwisp_group }}" tags: [wireguard, updater_script] - notify: reload supervisor + notify: restart wireguard vpn updater - name: Add wireguard_update.sh script to cron cron: @@ -79,7 +79,7 @@ tags: [wireguard, updater_script] - name: Deploy VPN updater flask app - notify: reload supervisor + notify: restart wireguard vpn updater template: src: flask/vpn_updater.py dest: "{{ openwisp2_wireguard_path }}/vpn_updater.py" @@ -98,5 +98,5 @@ src: supervisor/vpn_updater.j2 dest: "{{ supervisor_conf_path }}/flask_vpn_updater_{{ openwisp2_wireguard_vpn_uuid }}.{{ supervisord_conf_extension }}" mode: 0744 - notify: reload supervisor + notify: restart wireguard vpn updater tags: [flask] diff --git a/tasks/pip.yml b/tasks/pip.yml index 12a8fb4..2ba1569 100644 --- a/tasks/pip.yml +++ b/tasks/pip.yml @@ -17,7 +17,7 @@ delay: 10 register: result until: result is success - notify: reload supervisor + notify: restart wireguard vpn updater - name: Copy requirements.txt copy: @@ -31,7 +31,7 @@ virtualenv_python: "{{ openwisp2_wireguard_python }}" virtualenv_site_packages: true virtualenv_command: "{{ openwisp2_wireguard_virtualenv_command }}" - notify: reload supervisor + notify: restart wireguard vpn updater retries: 5 delay: 10 register: result diff --git a/tasks/uwsgi.yml b/tasks/uwsgi.yml index f47b0d7..6dc631d 100644 --- a/tasks/uwsgi.yml +++ b/tasks/uwsgi.yml @@ -55,9 +55,8 @@ - certbot_check.rc == 0 - certbot_check.stdout != "" tags: [ssl] - - name: uwsgi.ini - notify: reload supervisor + notify: restart wireguard vpn updater template: src: flask/uwsgi.ini dest: "{{ openwisp2_wireguard_path }}/uwsgi.ini"