diff --git a/uwsgi-python/files/apps/pgdg.pref b/uwsgi-python/files/apps/pgdg.pref new file mode 100644 index 0000000000000000000000000000000000000000..ac6889cc2ed340519f931372cffb62004c953486 --- /dev/null +++ b/uwsgi-python/files/apps/pgdg.pref @@ -0,0 +1,3 @@ +Package: * +Pin: release o=apt.postgresql.org +Pin-Priority: 200 diff --git a/uwsgi-python/handlers/main.yml b/uwsgi-python/handlers/main.yml index 2dcefe69963f1a20bd5b2eebad029eb14ba3683c..783684a0313d4e2fe2789ecdead8c8ba4b0bfc25 100644 --- a/uwsgi-python/handlers/main.yml +++ b/uwsgi-python/handlers/main.yml @@ -113,3 +113,6 @@ - name: restart uwsgi instance gl-rt-bridge service: name="uwsgi@gl-rt-bridge" state=restarted + +- name: restart uwsgi instance pgadmin4 + service: name="uwsgi@pgadmin4" state=restarted diff --git a/uwsgi-python/tasks/app.yml b/uwsgi-python/tasks/app.yml index 976008611309ea4ead2d06291a3fb336379fe204..d5285dd3f205fcbc6d9df565be58dee6ec9f41c4 100644 --- a/uwsgi-python/tasks/app.yml +++ b/uwsgi-python/tasks/app.yml @@ -175,6 +175,7 @@ - app_deploy_key is defined - app_deploy_key|string != '' # noqa 602 - (app_git_pip is not defined) or (not app_git_pip) + - app_git_url|string != '' # noqa 602 register: git tags: - uwsgi-app @@ -194,6 +195,7 @@ # yamllint disable-line rule:line-length - (app_deploy_key is not defined) or (not app_deploy_key|string != '') # noqa 602 - (app_git_pip is not defined) or (not app_git_pip) + - app_git_url|string != '' # noqa 602 register: git tags: - uwsgi-app @@ -247,7 +249,7 @@ - "{{ app_path }}/vendor" when: - app_gemfile is defined - - app_gemfile|string != '' + - app_gemfile|string != '' # noqa 602 - app_lang == "ruby" tags: - uwsgi-app @@ -264,7 +266,7 @@ become_user: "{{ app_user }}" when: - app_gemfile is defined - - app_gemfile|string != '' + - app_gemfile|string != '' # noqa 602 - app_lang == "ruby" tags: - uwsgi-app diff --git a/uwsgi-python/tasks/apps/pgadmin4.yml b/uwsgi-python/tasks/apps/pgadmin4.yml new file mode 100644 index 0000000000000000000000000000000000000000..9a8660daff13ef1cf4d9a23e99c70e6a6bf5e9eb --- /dev/null +++ b/uwsgi-python/tasks/apps/pgadmin4.yml @@ -0,0 +1,45 @@ +--- + +- name: Add the Postgres APT repo signing key + apt_key: + url: "https://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc" + id: B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 + +- name: Pin Postgres APT repo + copy: + src: pgdg.pref + dest: /etc/apt/preferences.d/pgdg.pref + +- name: Enable Postgres APT repository + apt_repository: + # yamllint disable-line rule:line-length + repo: "deb https://apt.postgresql.org/pub/repos/apt/ {{ debian_version }}-pgdg main" + +- name: Debconf pgadmin4 + debconf: + pkg: pgadmin4-apache2 + question: "pgadmin4/{{ item.k }}" + value: "{{ item.v }}" + vtype: "{{ item.t }}" + loop: + - {k: password, v: "{{ pgadmin4_admin_password }}", t: password} + - {k: email, v: "{{ pgadmin4_admin_email }}", t: string} + +- name: Install pgAdmin4 + apt: + # In contrast to the name, this is the general WSGI package + # It does not depend hard on apache2, but rather on any wsgi webserver + name: pgadmin4-apache2 + +- name: Install newer version of python3-flaskext.wtf + apt: + name: python3-flaskext.wtf + default_release: stretch-pgdg + when: debian_version == "stretch" + +- name: Fix directory permissions + file: + path: "{{ item }}" + state: directory + owner: "{{ app_user }}" + recurse: true diff --git a/uwsgi-python/vars/pgadmin4.yml b/uwsgi-python/vars/pgadmin4.yml new file mode 100644 index 0000000000000000000000000000000000000000..2df22a7c34db399092cad575330f0ef6e3f890c5 --- /dev/null +++ b/uwsgi-python/vars/pgadmin4.yml @@ -0,0 +1,17 @@ +--- + +app_home: /var/lib/pgadmin +app_path: /usr/share/pgadmin4/web +app_program: pgAdmin4.wsgi +app_callable: application +app_mountpoint: /pgadmin4 +app_workers: 1 +app_enable_threads: true +app_uwsgi_options: + - "threads = 25" +app_db_type: sqlite +app_secret_config: false +app_config_file: "" +app_requirements_file: "" +app_venv: "" +app_deploy_key: ""