mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2025-01-11 04:10:17 +01:00
27 lines
744 B
YAML
27 lines
744 B
YAML
---
|
|
# This playbook will install MySQL and create db user and give permissions.
|
|
|
|
- name: Install Mysql package
|
|
yum: pkg=$item state=installed
|
|
with_items:
|
|
- mysql-server
|
|
- MySQL-python
|
|
- libselinux-python
|
|
- libsemanage-python
|
|
|
|
- name: Configure SELinux to start mysql on any port
|
|
seboolean: name=mysql_connect_any state=true persistent=yes
|
|
|
|
- name: Create Mysql configuration file
|
|
template: src=my.cnf.j2 dest=/etc/my.cnf
|
|
notify:
|
|
- restart mysql
|
|
|
|
- name: Start Mysql Service
|
|
service: name=mysqld state=started enabled=true
|
|
|
|
- name: Create Application Database
|
|
mysql_db: name=$dbname state=present
|
|
|
|
- name: Create Application DB User
|
|
mysql_user: name=$dbuser password=$upassword priv=*.*:ALL host='%' state=present
|