Skip to content

Commit

Permalink
[Elao - App] PostgreSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
maximecolin committed Sep 13, 2021
1 parent 378fd11 commit fd44a67
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions elao.app/.manala.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ system:
# @option {"label": "MySQL version"}
# @schema {"enum": [null, "8.0", 5.7, 5.6]}
version: ~
postgresql:
# @option {"label": "PostgreSQL version"}
# @schema {"enum": [null, 13]}
version: ~
redis:
# @option {"label": "Redis version"}
# @schema {"enum": [null, "*"]}
Expand Down
5 changes: 5 additions & 0 deletions elao.app/.manala.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ system:
version: {{ .mysql.version | toYaml }}
{{- end }}

{{- if .postgresql.version }}
postgresql:
version: {{ .postgresql.version | toYaml }}
{{- end }}

{{- if .redis.version }}
redis:
version: {{ .redis.version | toYaml }}
Expand Down
5 changes: 5 additions & 0 deletions elao.app/.manala/ansible/inventories/system.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ system:
system_mysql_version: {{ .mysql.version | toYaml }}
system_mysql_install_packages: null
system_mysql_configs_dir: /etc/mysql/mysql.conf.d
# PostgreSQL
system_postgresql: false
system_postgresql_version: {{ .postgresql.version | toYaml }}
# Network
system_network: false
# Nginx
Expand Down Expand Up @@ -181,6 +184,8 @@ system:
system_motd: true
# MySQL
system_mysql: {{ not (empty .mysql.version) | ternary "true" "false" }}
# PostgreSQL
system_postgresql: {{ not (empty .postgresql.version) | ternary "true" "false" }}
# Network
system_network: {{ not (empty .network.hosts) | ternary "true" "false" }}
{{- dict "system_network_hosts" .network.hosts | toYaml | nindent 12 }}
Expand Down
28 changes: 28 additions & 0 deletions elao.app/.manala/ansible/system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@
'default'
}}"
state: "{{ 'present' if (system_mariadb) else 'ignore' }}"
# PostgreSQL
- preference: postgresql@postgresql
state: "{{ 'present' if (system_postgresql) else 'ignore' }}"
# Redis
- preference: redis@backports
state: "{{ 'present' if (
Expand Down Expand Up @@ -333,6 +336,26 @@
host: localhost
state: absent

##############
# PostgreSQL #
##############

manala_postgresql_version: "{{ system_postgresql_version }}"
manala_postgresql_roles:
- role: "root"
password: ~
attributes: ['SUPERUSER']
manala_postgresql_config_template: config/default.dev.j2
manala_postgresql_config:
- max_connections: 123
manala_postgresql_config_hba_template: config/hba/default.dev.j2
manala_postgresql_config_hba:
- local all postgres peer
- local all all peer
- host all all 127.0.0.1/32 md5
- host all all ::1/128 md5
- local foo bar peer

###########
# Network #
###########
Expand Down Expand Up @@ -602,6 +625,11 @@
when: system_mysql or system_mariadb
tags: [mysql, mariadb]

- import_role:
name: postgresql
when: system_postgresql
tags: [postgresql]

- import_role:
name: java
when: system_java
Expand Down

0 comments on commit fd44a67

Please sign in to comment.