Advertisement
Guest User

Untitled

a guest
Apr 1st, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. - hosts: webservers
  2. tasks:
  3. - name: Install MySQL
  4. action: apt pkg={{ item }} state=installed
  5. with_items:
  6. - libmysqlclient-dev
  7. - python-mysqldb
  8. - mysql-server
  9. - mysql-client
  10.  
  11. - name: Start the MySQL service
  12. action: service name=mysql state=started
  13.  
  14. - name: Create deploy user for mysql
  15. mysql_user: user="deploy" host="%" password=password priv=*.*:ALL,GRANT
  16.  
  17. - name: Ensure anonymous users are not in the database
  18. mysql_user: user='' host={{ item }} state=absent
  19. with_items:
  20. - 127.0.0.1
  21. - ::1
  22. - localhost
  23.  
  24. - name: Update mysql root password for all root accounts
  25. mysql_user: name=root host={{ item }} password=password
  26. with_items:
  27. - 127.0.0.1
  28. - ::1
  29. - localhost
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement