mirror of
https://github.com/2martens/cloud-configuration.git
synced 2026-10-17 16:46:51 +02:00
change: Only run postgresql setup if the database is not initialized yet
Otherwise, it would repeatedly try to create the database over an existing one.
This commit is contained in:
@@ -11,7 +11,12 @@
|
||||
when: active_postgresql_version.stdout.find(postgresql_version) == -1
|
||||
- name: Extend bash profile
|
||||
ansible.builtin.import_tasks: profile.yaml
|
||||
- name: Check if postgresql database is created
|
||||
ansible.builtin.stat:
|
||||
path: ~/opt/postgresql/data
|
||||
register: postgresql_dir
|
||||
- name: Set up postgresql
|
||||
when: not postgresql_dir.stat.exists
|
||||
ansible.builtin.import_tasks: setup.yaml
|
||||
- name: Set up service
|
||||
ansible.builtin.import_tasks: service.yaml
|
||||
Reference in New Issue
Block a user