Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Elao - App] PostgreSQL #149

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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