|
|
|
@ -1,4 +1,10 @@ |
|
|
|
|
--- |
|
|
|
|
- name: Disallow root login remotely |
|
|
|
|
command: 'mysql -NBe "{{ item }}"' |
|
|
|
|
with_items: |
|
|
|
|
- DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1') |
|
|
|
|
changed_when: False |
|
|
|
|
|
|
|
|
|
- name: Get list of hosts for the root user. |
|
|
|
|
command: mysql -NBe 'SELECT Host FROM mysql.user WHERE User = "root" ORDER BY (Host="localhost") ASC' |
|
|
|
|
register: mysql_root_hosts |
|
|
|
|