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

Readd support for secure PostgreSQL password hashes (#1074) #1136

Merged
merged 5 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions roles/zabbix_proxy/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ zabbix_proxy_dbencoding: utf8
zabbix_proxy_dbhost: localhost
zabbix_proxy_dbname: zabbix_proxy
zabbix_proxy_dbpassword: zabbix_proxy
zabbix_proxy_dbpassword_hash_method: md5
zabbix_proxy_dbuser: zabbix_proxy
zabbix_proxy_install_database_client: true

Expand Down
4 changes: 2 additions & 2 deletions roles/zabbix_proxy/tasks/postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions roles/zabbix_server/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ zabbix_server_dbcollation: utf8_bin
zabbix_server_dbschema:
zabbix_server_dbuser: zabbix-server
zabbix_server_dbpassword: zabbix-server
zabbix_server_dbpassword_hash_method: md5
zabbix_server_dbsocket:
zabbix_server_dbport: 5432
zabbix_server_dbhost_run_install: true
Expand Down
4 changes: 2 additions & 2 deletions roles/zabbix_server/tasks/postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading