Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
poc_irods
poc-irods
Commits
d30b0da7
Commit
d30b0da7
authored
Oct 13, 2020
by
viscapi
Browse files
Fixed a non working conditional for Debian
parent
54844115
Changes
1
Hide whitespace changes
Inline
Side-by-side
postgresql/tasks/db_init.yml
View file @
d30b0da7
---
-
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)
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment