diff --git a/roles/zabbix_proxy/tasks/postgresql.yml b/roles/zabbix_proxy/tasks/postgresql.yml index 291052455..e71af9aba 100644 --- a/roles/zabbix_proxy/tasks/postgresql.yml +++ b/roles/zabbix_proxy/tasks/postgresql.yml @@ -29,7 +29,7 @@ community.postgresql.postgresql_user: db: "{{ zabbix_proxy_dbname }}" name: "{{ zabbix_proxy_dbuser }}" - password: "md5{{ (zabbix_proxy_dbpassword + zabbix_proxy_dbuser)|hash('md5') }}" + password: "{{ ('md5' + (zabbix_proxy_dbpassword + zabbix_proxy_dbuser)|hash('md5')) if zabbix_proxy_dbpassword_hash_method == 'md5' else zabbix_proxy_dbpassword }}" port: "{{ zabbix_proxy_dbport }}" priv: ALL state: present @@ -61,7 +61,7 @@ login_password: "{{ zabbix_proxy_pgsql_login_password | default(omit) }}" db: "{{ zabbix_proxy_dbname }}" name: "{{ zabbix_proxy_dbuser }}" - password: "md5{{ (zabbix_proxy_dbpassword + zabbix_proxy_dbuser)|hash('md5') }}" + password: "{{ ('md5' + (zabbix_proxy_dbpassword + zabbix_proxy_dbuser)|hash('md5')) if zabbix_proxy_dbpassword_hash_method == 'md5' else zabbix_proxy_dbpassword }}" port: "{{ zabbix_proxy_dbport }}" priv: ALL state: present diff --git a/roles/zabbix_server/tasks/postgresql.yml b/roles/zabbix_server/tasks/postgresql.yml index 947a73462..5177a55be 100644 --- a/roles/zabbix_server/tasks/postgresql.yml +++ b/roles/zabbix_server/tasks/postgresql.yml @@ -29,7 +29,7 @@ community.postgresql.postgresql_user: db: "{{ zabbix_server_dbname }}" name: "{{ zabbix_server_dbuser }}" - password: "md5{{ (zabbix_server_dbpassword + zabbix_server_dbuser)|hash('md5') }}" + password: "{{ ('md5' + (zabbix_server_dbpassword + zabbix_server_dbuser)|hash('md5')) if zabbix_server_dbpassword_hash_method == 'md5' else zabbix_server_dbpassword }}" port: "{{ zabbix_server_dbport }}" priv: ALL state: present @@ -68,7 +68,7 @@ login_password: "{{ zabbix_server_pgsql_login_password | default(omit) }}" db: "{{ zabbix_server_dbname }}" name: "{{ zabbix_server_dbuser }}" - password: "md5{{ (zabbix_server_dbpassword + zabbix_server_dbuser)|hash('md5') }}" + password: "{{ ('md5' + (zabbix_server_dbpassword + zabbix_server_dbuser)|hash('md5')) if zabbix_server_dbpassword_hash_method == 'md5' else zabbix_server_dbpassword }}" port: "{{ zabbix_server_dbport }}" priv: ALL state: present