Merge pull request #75 from BlackMesh/delete_root_external

Disallow root login remotely
pull/63/head
Jeff Geerling 9 years ago
commit b499ee05c4
  1. 6
      tasks/secure-installation.yml

@ -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