db_init.yml 530 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
---

- name: Check that the database doesn't exist yet on Ubuntu
  stat:
    path: "/etc/postgresql/{{ postgresql_version.version.major }}/{{ cluster_name }}/postgresql.conf"
  register: stat_result_ubuntu

- name: Initialization of ICAT database on Ubuntu 18.04
  command: /usr/bin/pg_createcluster -d {{ path_to_icat }} {{ postgresql_version.version.major }} {{ cluster_name }}
  become: true
  become_user: postgres
12
  when: (ansible_facts['distribution_major_version'] == "18" and stat_result_ubuntu.stat.exists == False)
13
14

...