Don't log sensitive data

This commit is contained in:
LinuxSquare 2024-12-01 21:30:07 +01:00
parent 8008a16081
commit 07d1d844e3

View file

@ -4,25 +4,28 @@
stat: stat:
path: /var/lib/mysql/.secured path: /var/lib/mysql/.secured
register: MYSQL_SECURED_RESULT register: MYSQL_SECURED_RESULT
ignore_errors: true
- name: Set the root password - name: Set the root password
mysql_user: login_user=root login_password="" user=root password="{{mysql_root_password}}" host="{{item}}" mysql_user: login_user=root login_password="" user=root password="{{mysql_root_password}}" host="{{item}}"
with_items: with_items:
- 127.0.0.1 - 127.0.0.1
- ::1 - ::1
- localhost - localhost
no_log: true
when: not MYSQL_SECURED_RESULT.stat.exists when: not MYSQL_SECURED_RESULT.stat.exists
- name: Delete anonymous MySQL user - name: Delete anonymous MySQL user
mysql_user: login_user=root login_password="{{mysql_root_password}}" name="" host="{{item}}" state=absent mysql_user: login_user=root login_password="{{mysql_root_password}}" name="" host="{{item}}" state=absent
with_items: with_items:
- localhost - localhost
- "{{ansible_nodename}}" - "{{ansible_nodename}}"
no_log: true
when: not MYSQL_SECURED_RESULT.stat.exists when: not MYSQL_SECURED_RESULT.stat.exists
- name: Delete Hostname based MySQL user - name: Delete Hostname based MySQL user
mysql_user: login_user=root login_password="{{mysql_root_password}}" user=root host="{{ansible_nodename}}" state=absent mysql_user: login_user=root login_password="{{mysql_root_password}}" user=root host="{{ansible_nodename}}" state=absent
no_log: true
when: not MYSQL_SECURED_RESULT.stat.exists when: not MYSQL_SECURED_RESULT.stat.exists
- name: Remove MySQL test database - name: Remove MySQL test database
mysql_db: login_user=root login_password="{{mysql_root_password}}" name=test state=absent mysql_db: login_user=root login_password="{{mysql_root_password}}" name=test state=absent
no_log: true
when: not MYSQL_SECURED_RESULT.stat.exists when: not MYSQL_SECURED_RESULT.stat.exists
- name: Create .secured lock file - name: Create .secured lock file
file: file: