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 10, 2021
1 parent 378fd11 commit baef59e
Show file tree
Hide file tree
Showing 4 changed files with 20 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
6 changes: 6 additions & 0 deletions elao.app/.manala/ansible/system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@
'default'
}}"
state: "{{ 'present' if (system_mariadb) else 'ignore' }}"
# PostgreSQL
- preference: "postgresql@{{
'postgresql_' ~ system_postgresql_version|string|replace('.', '_') if (system_postgresql) else
'default'
}}"
state: "{{ 'present' if (system_postgresql) else 'ignore' }}"
# Redis
- preference: redis@backports
state: "{{ 'present' if (
Expand Down

0 comments on commit baef59e

Please sign in to comment.