Skip to content

Instantly share code, notes, and snippets.

@ranjib
Last active December 22, 2015 10:28
Show Gist options
  • Save ranjib/6458717 to your computer and use it in GitHub Desktop.
Save ranjib/6458717 to your computer and use it in GitHub Desktop.
Install chef server via chef apply
remote_file '/opt/chef-server.deb' do
source 'https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chef-server_11.0.8-1.ubuntu.12.04_amd64.deb'
not_if {File.exists?('/opt/chef-server.deb')}
end
dpkg_package 'chef-server' do
source '/opt/chef-server.deb'
action :install
end
execute "reconfigure_chef_server" do
command "chef-server-ctl reconfigure"
end
ip = if node.attribute?(:ec2)
node.ec2.public_ipv4
else
node.ipaddress
end
file '/etc/chef-server/chef-server.rb' do
content "bookshelf['url'] = 'https://#{ip}'
bookshelf['vip'] = '#{ip}'"
notifies :run, "execute[reconfigure_chef_server]"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment