Skip to content

Instantly share code, notes, and snippets.

@dev-gwang
Created May 27, 2020 04:10
Show Gist options
  • Save dev-gwang/644ed39df82a2b6ce5321f3ae3144d7d to your computer and use it in GitHub Desktop.
Save dev-gwang/644ed39df82a2b6ce5321f3ae3144d7d to your computer and use it in GitHub Desktop.
chef server install Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
vb.cpus = 2
end
config.vm.provision "shell", inline: <<-SHELL
sudo yum update -y
cnt=` sudo rpm -qa | grep chef-server`
if [[ $cnt == 0 ]]; then
sudo rpm -Uvh https://packages.chef.io/repos/yum/stable/el/7/x86_64/chef-server-core-13.2.0-1.el7.x86_64.rpm
fi
sudo chef-server-ctl user-create USER_NAME FIRST_NAME LAST_NAME EMAIL 'PASSWORD'
echo "yes" | sudo chef-server-ctl reconfigure
sudo chef-server-ctl install chef-manage
sudo chef-manage-ctl reconfigure --accept-license
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment