You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
741 B
YAML

---
- meta: flush_handlers
- name: Create SQL user {{ database_user }}
mysql_user:
state: present
host: localhost
user: "{{ database_user }}"
password: "{{ database_pass }}"
update_password: always
priv: "{{ database_name }}.*:ALL"
login_unix_socket: "/var/run/mysqld/mysqld.sock"
- name: Create SQL database {{ database_name }}
mysql_db:
db: "{{ database_name }}"
login_unix_socket: "/var/run/mysqld/mysqld.sock"
# TODO Move backup job to special user
- name: Configure auto backup for {{ database_name }}
cron:
hour: 1
minute: 0
job: "{{ global_helper_directory }}/backup_database.sh {{ database_name | quote }}"
name: "backup database {{ database_name }}"
state: present