Commit d30b0da7 authored by viscapi's avatar viscapi
Browse files

Fixed a non working conditional for Debian

parent 54844115
---
- name: On vérifie que la base n'existe pas déjà
- name: On vérifie que la base n'existe pas déjà sur CentOS
stat:
path: "{{path_to_icat}}/postgresql.conf"
register: stat_result
when: (ansible_facts['distribution'] == "CentOS")
register: stat_result_centos
when: ansible_facts['distribution'] == "CentOS"
- name: Initialisation de la base de données ICAT
- name: On vérifie que la base n'existe pas déjà sur Debian
stat:
path: "/etc/postgresql/{{ postgresql_version.version.major }}/{{ cluster_name }}/postgresql.conf"
register: stat_result_debian
when: ansible_facts['distribution'] == "Debian"
- name: Initialisation de la base de données ICAT sur CentOS 7
command: /usr/pgsql-9.6/bin/initdb -D {{path_to_icat}}
become: true
become_user: postgres
when: stat_result.stat.exists == False and (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7")
when: stat_result_centos.stat.exists == False and (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7")
- name: Initialisation de la base de données ICAT
- name: Initialisation de la base de données ICAT sur CentOS 8
command: /usr/bin/initdb -D {{path_to_icat}}
become: true
become_user: postgres
when: stat_result.stat.exists == False and (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "8")
- name: Initialisation de la base de données ICAT
command: /usr/bin/pg_createcluster -d {{ path_to_icat }} {{ postgresql_version.version.major }} {{ cluster_name }}
become: true
become_user: postgres
when: (ansible_facts['distribution'] == "Debian" and ansible_facts['distribution_major_version'] == "10")
when: stat_result_centos.stat.exists == False and (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "8")
- name: Initialisation de la base de données ICAT sur Debian 10
command: /usr/bin/pg_createcluster -d {{ path_to_icat }} {{ postgresql_version.version.major }} {{ cluster_name }}
become: true
become_user: postgres
when: (ansible_facts['distribution'] == "Debian" and ansible_facts['distribution_major_version'] == "10" and stat_result_debian.stat.exists == False)
...
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment