File tree Expand file tree Collapse file tree 6 files changed +16
-16
lines changed Expand file tree Collapse file tree 6 files changed +16
-16
lines changed Original file line number Diff line number Diff line change 22
33- name : " Restart percona"
44 service : " name=mysql state=restarted"
5- sudo : yes
5+ become : yes
Original file line number Diff line number Diff line change 44 template : " src=etc_mysql_my.cnf.j2 dest=/etc/mysql/my.cnf owner=root mode=0600"
55 notify :
66 - " Restart percona"
7- sudo : yes
7+ become : yes
Original file line number Diff line number Diff line change 77 state : present
88 with_items : mysql_databases
99 when : (mysql_databases is defined) and (mysql_databases | length > 0)
10- sudo : yes
10+ become : yes
Original file line number Diff line number Diff line change 22
33- name : " Obtaining percona public key"
44 apt_key : " url=http://www.percona.com/downloads/RPM-GPG-KEY-percona state=present"
5- sudo : yes
5+ become : yes
66
77- name : " Adding percona repository"
88 apt_repository : " repo='deb http://repo.percona.com/apt {{ ansible_distribution_release }} main' state=present"
9- sudo : yes
9+ become : yes
1010
1111- name : " Update apt cache"
1212 apt : " update_cache=yes cache_valid_time=300"
13- sudo : yes
13+ become : yes
1414
1515- name : " Install percona database server"
1616 action : " apt pkg={{ item }} state=latest"
2020 - " percona-toolkit"
2121 - " percona-xtrabackup"
2222 - " python-mysqldb"
23- sudo : yes
23+ become : yes
2424
2525- name : " Adjust permissions of datadir"
2626 file : " path={{ mysql_datadir }} owner=mysql group=mysql mode=0700 state=directory"
27- sudo : yes
27+ become : yes
2828
2929- name : " Ensure that percona is running"
3030 service : " name=mysql state=started"
31- sudo : yes
31+ become : yes
3232
3333- name : " Ensure that percona is enabled"
3434 service : " name=mysql enabled=yes"
35- sudo : yes
35+ become : yes
Original file line number Diff line number Diff line change 88 - " ::1"
99 - " localhost"
1010 when : " ansible_hostname != 'localhost'"
11- sudo : yes
11+ become : yes
1212
1313- name : " Set the root password"
1414 mysql_user : " name=root host={{ item }} password={{ mysql_root_password }} check_implicit_admin=yes"
1717 - " ::1"
1818 - " localhost"
1919 when : " ansible_hostname == 'localhost'"
20- sudo : yes
20+ become : yes
2121
2222- name : " Copy .my.cnf file into the root home folder"
2323 template : " src=root-my-cnf.j2 dest=/root/.my.cnf owner=root group=root mode=0600"
24- sudo : yes
24+ become : yes
2525
2626- name : " Ensure anonymous users are not in the database"
2727 mysql_user : " name='' host={{ item }} state=absent"
2828 with_items :
2929 - " {{ ansible_hostname }}"
3030 - " localhost"
31- sudo : yes
31+ become : yes
3232
3333- name : " Remove the test database"
3434 mysql_db : " name=test state=absent"
35- sudo : yes
35+ become : yes
Original file line number Diff line number Diff line change 99 host : " {{ item.host | default('localhost') }}"
1010 with_items : mysql_users
1111 when : (mysql_users is defined) and (mysql_users|length > 0)
12- sudo : yes
12+ become : yes
You can’t perform that action at this time.
0 commit comments