add postgis
This commit is contained in:
parent
0486d81f8d
commit
903a166062
@ -10,3 +10,23 @@
|
||||
ansible.builtin.systemd:
|
||||
name: postgresql-13.service
|
||||
state: started
|
||||
|
||||
- name: create sql testing file
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
CREATE USER psql_testing_user with NOSUPERUSER CREATEDB NOCREATEROLE LOGIN encrypted password 'veryS3cr3t';
|
||||
CREATE DATABASE psql_test_db;
|
||||
ALTER DATABASE psql_test_db OWNER TO psql_testing_user;
|
||||
dest: /tmp/create_db_and_use.sql
|
||||
|
||||
- name: Verify | create pgsql users and database
|
||||
become: yes
|
||||
become_user: postgres
|
||||
ansible.builtin.shell: |
|
||||
psql -f /tmp/create_db_and_use.sql
|
||||
|
||||
- name: Verify | create EXTENSION postgis
|
||||
become: yes
|
||||
become_user: postgres
|
||||
ansible.builtin.shell: |
|
||||
psql psql_test_db -c 'CREATE EXTENSION postgis;'
|
||||
|
||||
@ -17,3 +17,25 @@
|
||||
- postgresql{{postgres_version}}
|
||||
- postgresql{{postgres_version}}-server
|
||||
state: present
|
||||
|
||||
- name: postgres | install | epel-release
|
||||
dnf:
|
||||
name: epel-release
|
||||
state: present
|
||||
|
||||
- name: postgres | install | enabled repo powertools
|
||||
yum_repository:
|
||||
name: powertools
|
||||
description: Rocky Linux $releasever - PowerTools
|
||||
file: external_repos
|
||||
mirrorlist: https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=PowerTools-$releasever
|
||||
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
|
||||
enabled: yes
|
||||
|
||||
- name: postgres | install | install postgis
|
||||
dnf:
|
||||
enablerepo: powertools
|
||||
name:
|
||||
- postgis31_13
|
||||
state: present
|
||||
when: postgis_install
|
||||
Loading…
Reference in New Issue
Block a user