36 lines
1.4 KiB
YAML
36 lines
1.4 KiB
YAML
|
---
|
||
|
- block:
|
||
|
- name: Create a user that will be the owner of the pgadmin files
|
||
|
user: name={{ pgadmin_user }} home={{ pgadmin_home }} createhome=no shell=/usr/sbin/nologin system=yes
|
||
|
|
||
|
- name: Download the pgadmin python installer
|
||
|
get_url: url=https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v4.1/pip/pgadmin4-4.1-py2.py3-none-any.whl dest={{ pgadmin_home }}
|
||
|
|
||
|
- name: Install the pgadmin pip modules
|
||
|
shell: python3 -m wheel install {{ pgadmin_home }}/pgadmin4-4.1-py2.py3-none-any.whl
|
||
|
args:
|
||
|
creates: '/usr/local/lib/python3.6/dist-packages/pgadmin4'
|
||
|
register: pgadmin_install
|
||
|
|
||
|
- name: Install the pgadmin configuration file
|
||
|
template: src=config_local.py.j2 dest=/usr/local/lib/python3.6/dist-packages/pgadmin4/config_local.py owner=root group=root
|
||
|
|
||
|
- name: run the pgadmin setup if we just installed the pip modules
|
||
|
shell: cd /usr/local/lib/python3.6/dist-packages/pgadmin4 ; python3 setup.py
|
||
|
when: pgadmin_install is changed
|
||
|
|
||
|
- name: Install the pgAdmin systemd unit
|
||
|
template: src=pgadmin.service.systemd.j2 dest=/etc/systemd/system/pgadmin.service
|
||
|
register: systemd_reload
|
||
|
|
||
|
- name: systemd reload
|
||
|
command: systemctl daemon-reload
|
||
|
when: systemd_reload is changed
|
||
|
|
||
|
- name: Ensure that the pgAdmin service is enabled and running
|
||
|
service: name=pgadmin state=started enabled=yes
|
||
|
|
||
|
when: not pgadmin_as_package
|
||
|
tags: [ 'pgadmin' ]
|
||
|
|