Class: Bard::Provision::MySQL
- Inherits:
-
Bard::Provision
- Object
- Struct
- Bard::Provision
- Bard::Provision::MySQL
- Defined in:
- lib/bard/new/provision/mysql.rb
Overview
install mysql
Instance Attribute Summary
Attributes inherited from Bard::Provision
Instance Method Summary collapse
Methods inherited from Bard::Provision
Instance Method Details
#call ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/bard/new/provision/mysql.rb', line 4 def call print "MySQL:" if !mysql_responding? print " Installing," provision_server.run! [ "sudo DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server", %{sudo mysql -uroot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '' PASSWORD EXPIRE NEVER; FLUSH PRIVILEGES;"}, %{mysql -uroot -e "UPDATE mysql.user SET password_lifetime = NULL WHERE user = 'root' AND host = 'localhost';"}, ].join("; "), home: true end puts " ✓" end |
#mysql_responding? ⇒ Boolean
18 19 20 |
# File 'lib/bard/new/provision/mysql.rb', line 18 def mysql_responding? provision_server.run "sudo systemctl is-active --quiet mysql", home: true, quiet: true end |