Update to 2020-09-18 13:00

master
Daniel Berteaud 4 years ago
parent 570334e6c5
commit e1d46cb502
  1. 2
      roles/pgadmin4/defaults/main.yml
  2. 2
      roles/pgadmin4/meta/main.yml
  3. 4
      roles/pgadmin4/tasks/conf.yml
  4. 2
      roles/pgadmin4/tasks/directories.yml
  5. 9
      roles/pgadmin4/tasks/facts.yml
  6. 34
      roles/pgadmin4/tasks/install.yml
  7. 2
      roles/pgadmin4/tasks/main.yml
  8. 6
      roles/pgadmin4/tasks/write_version.yml
  9. 4
      roles/pgadmin4/templates/pgadmin4.service.j2

@ -4,6 +4,6 @@ pga_id: 1
pga_port: 5050 pga_port: 5050
pga_src_ip: [] pga_src_ip: []
pga_root_dir: /opt/pgadmin4_{{ pga_id }} pga_root_dir: /opt/pgadmin4_{{ pga_id }}
pga_version: '4.25' pga_version: '4.26'
pga_pip_url: https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v{{ pga_version }}/pip/pgadmin4-{{ pga_version }}-py3-none-any.whl pga_pip_url: https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v{{ pga_version }}/pip/pgadmin4-{{ pga_version }}-py3-none-any.whl
pga_master_pass: False pga_master_pass: False

@ -1,3 +1 @@
--- ---
dependencies:
- role: repo_scl

@ -1,7 +1,7 @@
--- ---
- name: Deploy local configuration - name: Deploy local configuration
template: src=config_local.py.j2 dest={{ pga_root_dir }}/lib/python3.6/site-packages/pgadmin4/config_local.py template: src=config_local.py.j2 dest={{ pga_root_dir }}/venv/lib/python3.6/site-packages/pgadmin4/config_local.py
notify: restart pgadmin4 notify: restart pgadmin4
tags: pgadmin4 tags: pgadmin4
@ -12,7 +12,7 @@
- name: Initial setup of pgadmin4 - name: Initial setup of pgadmin4
expect: expect:
command: "{{ pga_root_dir }}/bin/python {{ pga_root_dir }}/lib/python3.6/site-packages/pgadmin4/setup.py" command: "{{ pga_root_dir }}/venv/bin/python {{ pga_root_dir }}/venv/lib/python3.6/site-packages/pgadmin4/setup.py"
echo: true echo: true
responses: responses:
'Email address:\s?': "admin@{{ ansible_domain }}" 'Email address:\s?': "admin@{{ ansible_domain }}"

@ -12,4 +12,6 @@
owner: pgadmin4_{{ pga_id }} owner: pgadmin4_{{ pga_id }}
- path: "{{ pga_root_dir }}/logs" - path: "{{ pga_root_dir }}/logs"
owner: pgadmin4_{{ pga_id }} owner: pgadmin4_{{ pga_id }}
- path: "{{ pga_root_dir }}/meta"
mode: 700
tags: pgadmin4 tags: pgadmin4

@ -5,3 +5,12 @@
register: pga_venv_27 register: pga_venv_27
tags: pgadmin4 tags: pgadmin4
- import_tasks: ../includes/webapps_set_install_mode.yml
vars:
- root_dir: "{{ pga_root_dir }}"
- version: "{{ pga_version }}"
tags: pgadmin4
- set_fact: pga_install_mode={{ install_mode }}
tags: pgadmin4
- set_fact: pga_current_version={{ current_version | default('') }}
tags: pgadmin4

@ -6,8 +6,8 @@
- gcc - gcc
- postgresql - postgresql
- postgresql-devel - postgresql-devel
- rh-python36-python-virtualenv - python3-virtualenv
- rh-python36-python-pip - python3-pip
- python-setuptools # Needed for pip install expect - python-setuptools # Needed for pip install expect
- python-pip # Also needed to install expect - python-pip # Also needed to install expect
tags: pgadmin4 tags: pgadmin4
@ -31,6 +31,21 @@
when: pga_venv_27.stat.exists when: pga_venv_27.stat.exists
tags: pgadmin4 tags: pgadmin4
- name: Wipe the venv on upgrade
file: path={{ pga_root_dir }}/{{ item }} state=absent
loop:
- lib
- lib64
- include
- bin
- venv
when: pga_install_mode != 'none'
tags: pgadmin4
- name: Create the venv dir
file: path={{ pga_root_dir }}/venv state=directory
tags: pgadmin4
- name: Create the virtualenv - name: Create the virtualenv
pip: pip:
name: name:
@ -39,19 +54,20 @@
- gunicorn - gunicorn
- futures - futures
- psycopg2 - psycopg2
- werkzeug==0.16.1 - werkzeug
- ldap3==2.6.1 - ldap3
state: latest virtualenv: "{{ pga_root_dir }}/venv"
virtualenv: "{{ pga_root_dir }}" virtualenv_command: /usr/bin/virtualenv-3
virtualenv_command: /opt/rh/rh-python36/root/usr/bin/virtualenv virtualenv_python: /usr/bin/python3
notify: restart pgadmin4 notify: restart pgadmin4
tags: pgadmin4 tags: pgadmin4
- name: Install pgadmin4 - name: Install pgadmin4
pip: pip:
name: "{{ pga_pip_url }}" name: "{{ pga_pip_url }}"
virtualenv: "{{ pga_root_dir }}" virtualenv: "{{ pga_root_dir }}/venv"
virtualenv_command: /opt/rh/rh-python36/root/usr/bin/virtualenv virtualenv_command: /usr/bin/virtualenv-3
virtualenv_python: /usr/bin/python3
register: pga_pip register: pga_pip
notify: restart pgadmin4 notify: restart pgadmin4
tags: pgadmin4 tags: pgadmin4

@ -8,4 +8,4 @@
- include: iptables.yml - include: iptables.yml
when: iptables_manage | default(True) when: iptables_manage | default(True)
- include: service.yml - include: service.yml
- include: write_version.yml

@ -0,0 +1,6 @@
---
- name: Write version
copy: content={{ pga_version }} dest={{ pga_root_dir }}/meta/ansible_version
tags: pgadmin4

@ -6,10 +6,10 @@ After=syslog.target network.target
Type=simple Type=simple
User=pgadmin4_{{ pga_id }} User=pgadmin4_{{ pga_id }}
Group=pgadmin4_{{ pga_id }} Group=pgadmin4_{{ pga_id }}
ExecStart={{ pga_root_dir }}/bin/gunicorn --bind 0.0.0.0:{{ pga_port }} \ ExecStart={{ pga_root_dir }}/venv/bin/gunicorn --bind 0.0.0.0:{{ pga_port }} \
--workers=1 \ --workers=1 \
--threads=25 \ --threads=25 \
--chdir {{ pga_root_dir }}/lib/python3.6/site-packages/pgadmin4 \ --chdir {{ pga_root_dir }}/venv/lib/python3.6/site-packages/pgadmin4 \
pgAdmin4:app pgAdmin4:app
ExecReload=/bin/kill -HUP $MAINPID ExecReload=/bin/kill -HUP $MAINPID
PrivateTmp=yes PrivateTmp=yes

Loading…
Cancel
Save