Sha256: fd71527115a6ec14ffb59da91cd23e607be8e53f90cc847bd01d603cf7234cf5

Contents?: true

Size: 625 Bytes

Versions: 5

Compression:

Stored size: 625 Bytes

Contents

# install mysql

class Bard::Provision::MySQL < Bard::Provision
  def call
    print "MySQL:"
    if !mysql_responding?
      print " Installing,"
      provision_server.run! [
        "sudo apt-get install -y mysql-server",
        %(sudo mysql -uroot -e "ALTER USER \\"'\\"root\\"'\\"@\\"'\\"localhost\\"'\\" IDENTIFIED WITH mysql_native_password BY \\"'\\"\\"'\\", \\"'\\"root\\"'\\"@\\"'\\"localhost\\"'\\" PASSWORD EXPIRE NEVER; FLUSH PRIVILEGES;"),
      ].join("; "), home: true
    end

    puts " ✓"
  end

  def mysql_responding?
    provision_server.run "sudo service mysql status | cat", quiet: true
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bard-1.0.5 lib/bard/provision/mysql.rb
bard-1.0.4 lib/bard/provision/mysql.rb
bard-1.0.3 lib/bard/provision/mysql.rb
bard-1.0.2 lib/bard/provision/mysql.rb
bard-1.0.1 lib/bard/provision/mysql.rb