Skip to content

Commit

Permalink
php-apache-mysql: Change mysql VM to use CentOS
Browse files Browse the repository at this point in the history
Due to problems with root authentication method on Ubuntu
Ref: sous-chefs/mysql#597 (comment)
  • Loading branch information
eduardobaitello committed Apr 25, 2021
1 parent a7c03b5 commit d65aa78
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions php-apache-mysql/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@ unless Vagrant.has_plugin?("vagrant-ohai")
raise "vagrant-ohai plugin is not installed! Install with 'vagrant plugin install vagrant-ohai'"
end

NODE_SCRIPT = <<EOF.freeze
NODE_SCRIPT_UBUNTU = <<EOF.freeze
echo "Preparing node..."
# Install chef client
wget -O - https://omnitruck.chef.io/install.sh | sudo bash -s -- -v 16.12
EOF

NODE_SCRIPT_CENTOS = <<EOF.freeze
echo "Preparing node..."
# ensure the time is up to date
yum -y install ntp
systemctl start ntpd
systemctl enable ntpd
curl -L https://omnitruck.chef.io/install.sh | sudo bash -s -- -v 16.12
EOF

def set_hostname(server)
server.vm.provision 'shell', inline: "hostname #{server.vm.hostname}"
end
Expand All @@ -23,20 +32,20 @@ config.vm.define 'phpapache' do |phpapache|
phpapache.vm.box_version = '20210401.01'
phpapache.vm.hostname = 'phpapache'
phpapache.vm.network "forwarded_port", guest: 80, host: 8080
phpapache.vm.provision :shell, inline: NODE_SCRIPT.dup
phpapache.vm.provision :shell, inline: NODE_SCRIPT_UBUNTU.dup
phpapache.vm.provider :virtualbox do |vb|
vb.gui = false
end
set_hostname(phpapache)
end

config.vm.define 'mysql' do |mysql|
mysql.vm.box = 'peru/ubuntu-20.04-server-amd64'
mysql.vm.box_url = 'https://app.vagrantup.com/peru/boxes/ubuntu-20.04-server-amd64'
mysql.vm.box_version = '20210401.01'
mysql.vm.box = 'bento/centos-7.9'
mysql.vm.box_url = 'https://vagrantcloud.com/bento/boxes/centos-7.9'
mysql.vm.box_version = '202103.18.0'
mysql.vm.hostname = 'mysql'
mysql.vm.network :private_network, ip: '192.168.10.100'
mysql.vm.provision :shell, inline: NODE_SCRIPT.dup
mysql.vm.provision :shell, inline: NODE_SCRIPT_CENTOS.dup
mysql.vm.provider :virtualbox do |vb|
vb.gui = false
end
Expand Down

0 comments on commit d65aa78

Please sign in to comment.