-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split some common tasks out, starting with mysql secure
- Loading branch information
1 parent
65dac30
commit 964a43e
Showing
2 changed files
with
43 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
## | ||
# MySQL database setup, this does the equivalent of mysql_secure_installation. | ||
# | ||
- name: Set the root password. | ||
action: mysql_user user=root password=$mysql_root_password host=localhost | ||
tags: common | ||
|
||
- name: MySQL config for easy access as root user | ||
action: template src=templates/root-my-cnf.j2 dest=/root/.my.cnf | ||
tags: common | ||
|
||
- name: Delete anonymous MySQL server user for $server_hostname | ||
action: mysql_user user="" host="$server_hostname" state="absent" | ||
tags: common | ||
|
||
- name: Delete anonymous MySQL server user for localhost | ||
action: mysql_user user="" state="absent" | ||
tags: common | ||
|
||
- name: Secure the MySQL root user for IPV6 localhost (::1) | ||
action: mysql_user user="root" password="$mysql_root_password" host="::1" | ||
tags: common | ||
|
||
- name: Secure the MySQL root user for IPV4 localhost (127.0.0.1) | ||
action: mysql_user user="root" password="$mysql_root_password" host="127.0.0.1" | ||
tags: common | ||
|
||
- name: Secure the MySQL root user for localhost domain (localhost) | ||
action: mysql_user user="root" password="$mysql_root_password" host="localhost" | ||
tags: common | ||
|
||
- name: Secure the MySQL root user for $server_hostname domain | ||
action: mysql_user user="root" password="$mysql_root_password" host="$server_hostname" | ||
tags: common | ||
|
||
- name: Remove the MySQL test database | ||
action: mysql_db db=test state=absent | ||
tags: common |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters