-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature] Added logging in update_wireguard.sh script #36
When the script is executed by the Flask app, the uwsgi log will contain the output from the update_wireguard.sh script. Closes #36 Co-authored-by: Gagan Deep <pandafy.dev@gmail.com> Co-authored-by: clutch2sft <148905f4@opayq.com>
- Loading branch information
1 parent
37d60f0
commit b34b5f4
Showing
4 changed files
with
190 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,85 @@ | ||
--- | ||
|
||
- name: "[CentOS7] Set virtualenv command" | ||
set_fact: | ||
openwisp2_wireguard_virtualenv_command: "virtualenv-3" | ||
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == "7" | ||
|
||
- name: Update pip & related tools | ||
pip: | ||
name: | ||
- pip | ||
- setuptools | ||
- wheel | ||
- attrs | ||
state: latest | ||
virtualenv: "{{ virtualenv_path }}" | ||
virtualenv_python: "{{ openwisp2_wireguard_python }}" | ||
virtualenv_site_packages: true | ||
virtualenv_command: "{{ openwisp2_wireguard_virtualenv_command }}" | ||
retries: 5 | ||
delay: 10 | ||
register: result | ||
until: result is success | ||
notify: reload supervisor | ||
- name: Install Python packages on non CentOS 7 OS | ||
when: not (ansible_distribution == 'CentOS' and ansible_distribution_major_version == "7") | ||
block: | ||
- name: Update pip & related tools | ||
pip: | ||
name: | ||
- pip | ||
- setuptools | ||
- wheel | ||
- attrs | ||
state: latest | ||
virtualenv: "{{ virtualenv_path }}" | ||
virtualenv_python: "{{ openwisp2_wireguard_python }}" | ||
virtualenv_site_packages: true | ||
virtualenv_command: "{{ openwisp2_wireguard_virtualenv_command }}" | ||
retries: 5 | ||
delay: 10 | ||
register: result | ||
until: result is success | ||
notify: reload supervisor | ||
- name: Install Flask, Werkzeug and uWSGI | ||
pip: | ||
name: | ||
- "Flask~=2.0.3" | ||
- "uwsgi~=2.0.19" | ||
- "Werkzeug>=2.0,<3.0" | ||
state: latest | ||
virtualenv: "{{ virtualenv_path }}" | ||
virtualenv_python: "{{ openwisp2_wireguard_python }}" | ||
virtualenv_site_packages: true | ||
virtualenv_command: "{{ openwisp2_wireguard_virtualenv_command }}" | ||
notify: reload supervisor | ||
retries: 5 | ||
delay: 10 | ||
register: result | ||
until: result is success | ||
|
||
- name: Install Flask, Werkzeug and uWSGI | ||
pip: | ||
name: | ||
- "Flask~=2.0.3" | ||
- "uwsgi~=2.0.19" | ||
- "Werkzeug>=2.0,<3.0" | ||
state: latest | ||
virtualenv: "{{ virtualenv_path }}" | ||
virtualenv_python: "{{ openwisp2_wireguard_python }}" | ||
virtualenv_site_packages: true | ||
virtualenv_command: "{{ openwisp2_wireguard_virtualenv_command }}" | ||
notify: reload supervisor | ||
retries: 5 | ||
delay: 10 | ||
register: result | ||
until: result is success | ||
- name: Install Python packages on CentOS 7 | ||
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == "7" | ||
# Use the the rh-devtoolset version of gcc when installing | ||
# Python packages. Without this, installing uwsgi fails. | ||
block: | ||
- set_fact: | ||
openwisp2_wireguard_virtualenv_command: "virtualenv-3" | ||
- name: Update pip & related tools | ||
pip: | ||
name: | ||
- pip | ||
- setuptools | ||
- wheel | ||
- attrs | ||
state: latest | ||
virtualenv: "{{ virtualenv_path }}" | ||
virtualenv_python: "{{ openwisp2_wireguard_python }}" | ||
virtualenv_site_packages: true | ||
virtualenv_command: "{{ openwisp2_wireguard_virtualenv_command }}" | ||
retries: 5 | ||
delay: 10 | ||
register: result | ||
until: result is success | ||
notify: reload supervisor | ||
environment: | ||
PATH: "/opt/rh/devtoolset-9/root/usr/bin:{{ ansible_env.PATH }}" | ||
LD_LIBRARY_PATH: "/opt/rh/devtoolset-9/root/usr/lib64" | ||
- name: Install Flask, Werkzeug and uWSGI | ||
pip: | ||
name: | ||
- "Flask~=2.0.3" | ||
- "uwsgi~=2.0.19" | ||
- "Werkzeug>=2.0,<3.0" | ||
state: latest | ||
virtualenv: "{{ virtualenv_path }}" | ||
virtualenv_python: "{{ openwisp2_wireguard_python }}" | ||
virtualenv_site_packages: true | ||
virtualenv_command: "{{ openwisp2_wireguard_virtualenv_command }}" | ||
notify: reload supervisor | ||
retries: 5 | ||
delay: 10 | ||
register: result | ||
until: result is success | ||
environment: | ||
PATH: "/opt/rh/devtoolset-9/root/usr/bin:{{ ansible_env.PATH }}" | ||
LD_LIBRARY_PATH: "/opt/rh/devtoolset-9/root/usr/lib64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters