From 4e984859529e9d0c8437620522730a174f835b56 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Sat, 18 Nov 2017 00:10:35 +0100 Subject: Add mariadb module --- requirements.yml | 2 ++ roles/mariadb/files/dump_mariadb.sh | 5 ----- roles/mariadb/handlers/main.yml | 3 --- roles/mariadb/tasks/main.yml | 16 ---------------- roles/mariadb/templates/custom.cnf | 4 ---- roles/mariadb/templates/my.cnf | 4 ---- 6 files changed, 2 insertions(+), 32 deletions(-) delete mode 100644 roles/mariadb/files/dump_mariadb.sh delete mode 100644 roles/mariadb/handlers/main.yml delete mode 100644 roles/mariadb/tasks/main.yml delete mode 100644 roles/mariadb/templates/custom.cnf delete mode 100644 roles/mariadb/templates/my.cnf diff --git a/requirements.yml b/requirements.yml index 7d45e95..e613f92 100644 --- a/requirements.yml +++ b/requirements.yml @@ -5,3 +5,5 @@ name: tor - src: https://github.com/OSAS/ansible-role-swap_file name: swap_file +- src: https://github.com/OSAS/ansible-role-mariadb + name: mariadb diff --git a/roles/mariadb/files/dump_mariadb.sh b/roles/mariadb/files/dump_mariadb.sh deleted file mode 100644 index 94ff66b..0000000 --- a/roles/mariadb/files/dump_mariadb.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -DIR=/var/backups/mariadb/ -[ -d $DIR ] || mkdir -p $DIR - -mysqldump --all-databases > $DIR/dump.sql diff --git a/roles/mariadb/handlers/main.yml b/roles/mariadb/handlers/main.yml deleted file mode 100644 index 6f737d9..0000000 --- a/roles/mariadb/handlers/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- name: restart mariadb - service: name=mariadb state=restarted diff --git a/roles/mariadb/tasks/main.yml b/roles/mariadb/tasks/main.yml deleted file mode 100644 index b6a4fe6..0000000 --- a/roles/mariadb/tasks/main.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- yum: name={{ item }} state=installed - with_items: - - mariadb-server - - MySQL-python - -- template: src=custom.cnf dest=/etc/my.cnf.d/custom.cnf - notify: restart mariadb - -- template: src=my.cnf dest=/root/.my.cnf mode=600 owner=root group=root - -- service: name=mariadb enabled=yes state=started - -- copy: mode=0755 src=dump_mariadb.sh dest=/usr/local/bin/dump_mariadb.sh - -- cron: minute=15 hour=4 name="backup mariadb" job=/usr/local/bin/dump_mariadb.sh diff --git a/roles/mariadb/templates/custom.cnf b/roles/mariadb/templates/custom.cnf deleted file mode 100644 index bbdfc4f..0000000 --- a/roles/mariadb/templates/custom.cnf +++ /dev/null @@ -1,4 +0,0 @@ -# {{ ansible_managed }} -[mysqld] -bind-address = 127.0.0.1 - diff --git a/roles/mariadb/templates/my.cnf b/roles/mariadb/templates/my.cnf deleted file mode 100644 index fa14aca..0000000 --- a/roles/mariadb/templates/my.cnf +++ /dev/null @@ -1,4 +0,0 @@ -[client] -user = root -password = {{ mariadb_pass }} - -- cgit