You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.5 KiB
68 lines
1.5 KiB
---
|
|
|
|
- name: Install packages
|
|
yum:
|
|
name:
|
|
- gcc
|
|
- postgresql
|
|
- postgresql-devel
|
|
- rh-python36-python-virtualenv
|
|
- rh-python36-python-pip
|
|
- python-setuptools # Needed for pip install expect
|
|
- python-pip # Also needed to install expect
|
|
tags: pgadmin4
|
|
|
|
- name: Install global python tools
|
|
pip: name=pexpect
|
|
tags: pgadmin4
|
|
|
|
- name: Stop pgAdmin4
|
|
service: name=pgadmin4_{{ pga_id }} state=stopped
|
|
when: pga_venv_27.stat.exists
|
|
tags: pgadmin4
|
|
|
|
- name: Remove the venv
|
|
file: path={{ pga_root_dir }}/{{ item }} state=absent
|
|
loop:
|
|
- lib
|
|
- lib64
|
|
- include
|
|
- bin
|
|
when: pga_venv_27.stat.exists
|
|
tags: pgadmin4
|
|
|
|
- name: Create the virtualenv
|
|
pip:
|
|
name:
|
|
- pip
|
|
- virtualenv
|
|
- gunicorn
|
|
- futures
|
|
- psycopg2
|
|
- werkzeug==0.16.1
|
|
state: latest
|
|
virtualenv: "{{ pga_root_dir }}"
|
|
virtualenv_command: /opt/rh/rh-python36/root/usr/bin/virtualenv
|
|
notify: restart pgadmin4
|
|
tags: pgadmin4
|
|
|
|
- name: Install pgadmin4
|
|
pip:
|
|
name: "{{ pga_pip_url }}"
|
|
virtualenv: "{{ pga_root_dir }}"
|
|
virtualenv_command: /opt/rh/rh-python36/root/usr/bin/virtualenv
|
|
register: pga_pip
|
|
notify: restart pgadmin4
|
|
tags: pgadmin4
|
|
|
|
- name: Deploy systemd unit
|
|
template: src=pgadmin4.service.j2 dest=/etc/systemd/system/pgadmin4_{{ pga_id }}.service
|
|
register: pga_systemd_unit
|
|
notify: restart pgadmin4
|
|
tags: pgadmin4
|
|
|
|
- name: Reload systemd
|
|
command: systemctl daemon-reload
|
|
when: pga_systemd_unit.changed
|
|
tags: pgadmin4
|
|
|
|
|