From f0b3711acfd79561d5fc43b9a19cde65b6ec3016 Mon Sep 17 00:00:00 2001 From: Bob Leers Date: Mon, 24 Jun 2019 16:38:15 +0200 Subject: [PATCH] [ADD] Option whether to (skip) install of PostgreSQL. This is particular beneficial in case PostgreSQL is on a different host or with containerized setups. --- defaults/main.yml | 1 + tasks/postgresql.yml | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index c270c5c..aefc658 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -33,6 +33,7 @@ odoo_repo_depth: 1 # Set to 0 to clone the full history (slower) odoo_reportlab_font_url: http://www.reportlab.com/ftp/pfbfer.zip # Tasks related to PostgreSQL +odoo_install_postgresql: True odoo_postgresql_set_user: True odoo_postgresql_user_role_attr: CREATEDB,NOSUPERUSER odoo_postgresql_extensions: diff --git a/tasks/postgresql.yml b/tasks/postgresql.yml index 250c72d..a5b5072 100644 --- a/tasks/postgresql.yml +++ b/tasks/postgresql.yml @@ -10,19 +10,20 @@ - name: PostgreSQL - Add the Odoo user postgresql_user: name={{ odoo_config_db_user }} role_attr_flags={{ odoo_postgresql_user_role_attr }} - when: odoo_postgresql_set_user + when: odoo_postgresql_set_user and odoo_install_postgresql - name: PostgreSQL - Set the Odoo user password postgresql_user: name={{ odoo_config_db_user }} password={{ odoo_config_db_passwd }} when: odoo_config_db_passwd is defined and odoo_config_db_passwd - and odoo_postgresql_set_user + and odoo_postgresql_set_user and odoo_install_postgresql - name: PostgreSQL - Activate some extensions on the 'template1' database postgresql_ext: name: "{{ item }}" db: template1 with_items: "{{ odoo_postgresql_extensions }}" + when: odoo_install_postgresql delegate_to: "{{ odoo_postgresql_delegate_to }}" remote_user: "{{ odoo_postgresql_remote_user }}"