diff --git a/elao.app/.manala.yaml b/elao.app/.manala.yaml index a535cb59..ef8d3e53 100644 --- a/elao.app/.manala.yaml +++ b/elao.app/.manala.yaml @@ -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, "*"]} diff --git a/elao.app/.manala.yaml.tmpl b/elao.app/.manala.yaml.tmpl index f64eaab5..cf96445c 100644 --- a/elao.app/.manala.yaml.tmpl +++ b/elao.app/.manala.yaml.tmpl @@ -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 }} diff --git a/elao.app/.manala/ansible/inventories/system.yaml.tmpl b/elao.app/.manala/ansible/inventories/system.yaml.tmpl index 0058a0d8..c1861bbc 100644 --- a/elao.app/.manala/ansible/inventories/system.yaml.tmpl +++ b/elao.app/.manala/ansible/inventories/system.yaml.tmpl @@ -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 @@ -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 }} diff --git a/elao.app/.manala/ansible/system.yaml b/elao.app/.manala/ansible/system.yaml index 475a6cc6..7c82ca91 100644 --- a/elao.app/.manala/ansible/system.yaml +++ b/elao.app/.manala/ansible/system.yaml @@ -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 ( @@ -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 # ########### @@ -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