40 lines
1.1 KiB
YAML
40 lines
1.1 KiB
YAML
---
|
|
- hosts: all
|
|
become: true
|
|
vars:
|
|
- mysql_root_password: "root_1337"
|
|
- vunerable_user_username: "vunerable"
|
|
- vunerable_user_password: "vunerable_1337"
|
|
- mysql_datadir: "/var/lib/mysql"
|
|
- mysql_allow_remote_connections: no
|
|
handlers:
|
|
- name: Restart MySQL
|
|
service:
|
|
name: mysql
|
|
state: restarted
|
|
tasks:
|
|
|
|
- name: Load default variables
|
|
include_vars:
|
|
dir: "vars/"
|
|
files_matching: main.yml
|
|
tags:
|
|
- load_default_variables
|
|
|
|
- name: set OS dependent variables
|
|
include_vars: '{{ item }}'
|
|
with_first_found:
|
|
- '{{ ansible_facts.distribution }}_{{ ansible_facts.distribution_major_version }}.yml'
|
|
- '{{ ansible_facts.distribution }}.yml'
|
|
- '{{ ansible_facts.os_family }}_{{ ansible_facts.distribution_major_version }}.yml'
|
|
- '{{ ansible_facts.os_family }}.yml'
|
|
tags: always
|
|
|
|
- include: "tasks/server_init.yml"
|
|
tags:
|
|
- mysql_installation
|
|
|
|
- include: "tasks/hardening.yml"
|
|
tags:
|
|
- mysql_hardening
|