Skip to content

Instantly share code, notes, and snippets.

@jmassardo
Last active August 27, 2018 18:45
Show Gist options
  • Save jmassardo/219d457b4bb729efac121964200f26e9 to your computer and use it in GitHub Desktop.
Save jmassardo/219d457b4bb729efac121964200f26e9 to your computer and use it in GitHub Desktop.
Minimum steps needed to install Chef Server and Automate with data collector
#### Install Automate Server ###
# Set up pre-reqs
sysctl -w vm.max_map_count=262144
sysctl -w vm.dirty_expire_centisecs=20000
# Make them permenant
vi /etc/sysctl.conf
vm.max_map_count=262144
vm.dirty_expire_centisecs=20000
# Download chef-automate tool
curl https://packages.chef.io/files/current/latest/chef-automate-cli/chef-automate_linux_amd64.zip | gunzip - > chef-automate && chmod +x chef-automate
# Create config
./chef-automate init-config
# Edit config and update FQDN to resolvable name
vi config.toml
# Install all the things!
./chef-automate deploy config.toml
# Browse to: https://automate.example.com/admin/tokens and generate new token
### Install Chef Server ###
# Download appropriate version of Chef Server
wget https://packages.chef.io/files/stable/chef-server/12.17.33/el/7/chef-server-core-12.17.33-1.el7.x86_64.rpm
# Install package
rpm -i chef-server-core-12.17.33-1.el7.x86_64.rpm
# Perform reconfigure
chef-server-ctl reconfigure
# Create initial admin user
chef-server-ctl user-create $chef_server_user $chef_server_user_firstname $chef_server_user_lastname $chef_server_user_email $chef_server_user_password --filename $chef_server_user_key.pem
# Create Chef Org
chef-server-ctl org-create $chef_server_org_shortname "$chef_server_org_fullname" --association_user $chef_server_user --filename $validator_name.pem
# Install Chef Manage
chef-server-ctl install chef-manage
chef-server-ctl reconfigure
chef-manage-ctl reconfigure
# Setup data collection on the chef server using the token from above
chef-server-ctl set-secret data_collector token '<STANDARD_API_TOKEN>'
chef-server-ctl restart nginx
chef-server-ctl restart opscode-erchef
# Add the following linces to the chef-server.rb
vi /etc/opscode/chef-server.rb
data_collector['root_url'] = 'https://automate.example.com/data-collector/v0/'
data_collector['proxy'] = true
profiles['root_url'] = 'https://automate.example.com'
# Save and close the file
# Reconfigure one more time
sudo chef-server-ctl reconfigure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment