Login to mysql with socket

This commit is contained in:
flyingscorpio@clevo 2022-03-12 18:29:35 +01:00
parent ff9eb0da61
commit e7246b995f

View file

@ -19,16 +19,34 @@
become: true
block:
- name: Set root password
mysql_user: user=root password="" host=localhost
mysql_user:
user: root
password: ""
host: localhost
login_unix_socket: /var/run/mysqld/mysqld.sock
- name: Remove anonymous user for ansible_fqdn
mysql_user: user="" host={{ ansible_fqdn }} state=absent
mysql_user:
user: ""
host: "{{ ansible_fqdn }}"
state: absent
login_unix_socket: /var/run/mysqld/mysqld.sock
- name: Remove anonymous user for localhost
mysql_user: user="" state=absent
mysql_user:
user: ""
state: absent
login_unix_socket: /var/run/mysqld/mysqld.sock
- name: Remove remote root access
mysql_user: user=root password="" host={{ item }}
mysql_user:
user: root
password: ""
host: "{{ item }}"
login_unix_socket: /var/run/mysqld/mysqld.sock
with_items:
- "::1"
- "127.0.0.1"
- localhost
- name: Remove test database
mysql_db: db=test state=absent
mysql_db:
db: test
state: absent
login_unix_socket: /var/run/mysqld/mysqld.sock