This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
---
|
||||
- name: Init PostgreSQL
|
||||
ansible.builtin.command: |
|
||||
initdb --locale=C.UTF-8 --encoding=UTF8 -D /var/lib/postgres/data
|
||||
initdb -D /var/lib/postgres/data
|
||||
args:
|
||||
creates: /var/lib/postgres/data/PG_VERSION
|
||||
become: true
|
||||
@@ -31,12 +31,13 @@
|
||||
role: cmsuser
|
||||
privs: ALL
|
||||
objs: ALL_IN_SCHEMA
|
||||
- name: CMS init DB
|
||||
ansible.builtin.shell: |
|
||||
sudo -iu cmsuser <<EOF
|
||||
cmsInitDB
|
||||
EOF
|
||||
- name: Check is CMS DB initialized
|
||||
community.postgresql.postgresql_table:
|
||||
db: cmsdb
|
||||
table: admins
|
||||
become: true
|
||||
become_user: cmsuser
|
||||
register: ret
|
||||
changed_when: ret.rc != 0
|
||||
become_user: postgres
|
||||
check_mode: true
|
||||
notify: CMS init DB
|
||||
- name: Flush handlers
|
||||
ansible.builtin.meta: flush_handlers
|
||||
|
||||
Reference in New Issue
Block a user