-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase.yml
40 lines (40 loc) · 1003 Bytes
/
database.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
- hosts: ghost.live
name: Install & Set MySQL
tasks:
- name: Installo i pacchetti necessari
apt:
name: ['software-properties-common', 'dirmngr', 'python3-pymysql']
state: present
- name: Installo MySQL
apt:
name: ['mysql-server']
state: present
- name: Abilito Systemd
systemd:
name: mysql
daemon_reload: yes
enabled: yes
- name: mysqld restart
service:
name: mysql
state: restarted
- name: Modifico root password
mysql_user:
name: root
password: '{{ mysql_root_password }}'
login_unix_socket: /run/mysqld/mysqld.sock
state: present
- name: Creo .my.cnf
copy:
content: |
[client]
user=root
password={{ mysql_root_password }}
dest: ~/.my.cnf
force: yes
- name: Rimuovo tutti gli utenti anonimi
mysql_user:
name: ''
host_all: yes
state: absent