faafo/ansible/tasks/database.yaml

24 lines
741 B
YAML

---
- apt: name={{ item }} state=latest
with_items:
- expect
- mysql-client
- mysql-server
- python-mysqldb
- lineinfile: dest=/etc/mysql/my.cnf regexp=^bind-address line=bind-address=0.0.0.0
- service: name=mysql state=restarted enabled=yes
- copy: src=files/mysql_secure_installation.sh
dest=/root/mysql_secure_installation.sh
mode=0755
- command: /root/mysql_secure_installation.sh
creates=/root/mysql_secure_installation.done
- copy: src=files/client.my.cnf dest=/root/.my.cnf
- mysql_db: name=tutorial state=present
- mysql_user: name=tutorial password=secretsecret priv=*.*:ALL host={{ item }} state=present
with_items:
- api
- localhost
- producer
- tracker
- worker