Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - hosts: webservers
- tasks:
- - name: Install MySQL
- action: apt pkg={{ item }} state=installed
- with_items:
- - libmysqlclient-dev
- - python-mysqldb
- - mysql-server
- - mysql-client
- - name: Start the MySQL service
- action: service name=mysql state=started
- - name: Create deploy user for mysql
- mysql_user: user="deploy" host="%" password=password priv=*.*:ALL,GRANT
- - name: Ensure anonymous users are not in the database
- mysql_user: user='' host={{ item }} state=absent
- with_items:
- - 127.0.0.1
- - ::1
- - localhost
- - name: Update mysql root password for all root accounts
- mysql_user: name=root host={{ item }} password=password
- with_items:
- - 127.0.0.1
- - ::1
- - localhost
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement