MySQL server installation with custom password in Ansible
When using Ansible for your provisioning your Vagrant, it can error due to MySQL prompting you for a password. The following Ansible code will allow you to automatically set the MySQL password during provisioning.
- name: Mysql | Set root password
shell: mysql-server-5.5 mysql-server/root_password password password | debconf-set-selections
tags: needed
- name: Mysql | Set root repassword again
shell: mysql-server-5.5 mysql-server/root_password_again password password | debconf-set-selections
tags: needed
- name: Installing MySQL
action: apt pkg=mysql-server state=latest
tags: needed
Did this help? Follow me on twitter @ ItsCatDev
Written by CatDev
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mysql
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#