summaryrefslogtreecommitdiffstats
path: root/pad/tasks/mariadb.yml
diff options
context:
space:
mode:
Diffstat (limited to 'pad/tasks/mariadb.yml')
-rw-r--r--pad/tasks/mariadb.yml22
1 files changed, 21 insertions, 1 deletions
diff --git a/pad/tasks/mariadb.yml b/pad/tasks/mariadb.yml
index 7a406c9..8e613b6 100644
--- a/pad/tasks/mariadb.yml
+++ b/pad/tasks/mariadb.yml
@@ -5,10 +5,30 @@
- mariadb-server
- mariadb-client
- python3-mysqldb
+- name: Ensure anonymous users are not in the database
+ mysql_user:
+ name: ""
+ host: "{{ item }}"
+ state: absent
+ with_items:
+ - localhost
+ - 127.0.0.1
+ - ::1
+ - "%"
+- name: Ensure mysql is configured to bind only to localhost
+ ini_file:
+ dest: /etc/mysql/my.cnf
+ section: mysqld
+ option: "bind-address"
+ value: "127.0.0.1"
- name: Start MariaDB
service:
name: mysql
- state: started
+ state: restarted
+ enabled: yes
+ runlevel:
+ - 3
+ - 5
- name: Ensure emacsconf-pad database exists
mysql_db:
name: "{{ etherpad_database_name }}"