Infra Server is the hub for configuration data. Chef Infra Server stores cookbooks, the policies applied to nodes, and metadata describing each registered node that Chef manages. Nodes use the Chef Infra Client to ask the Chef Infra Server for configuration details, such as recipes, templates, and file distributions.
Automate provides a unified view into infrastructure managed by Chef Infra, InSpec, and Habitat. In addition to providing views into operational, compliance, and workflow events, it includes a pipeline for continuous delivery of infrastructure and applications.
This blog will explain how to set up Infra and Automate servers in a single machine and on two different virtual machines. We will also demonstrate how to link these servers so they can communicate.
hostnamectl set-hostname hostname
. It’s critical that the fqdn
value in the file matches the hostname –f
value of the system. This works on AWS instances and local VMs. $ curl https://packages.chef.io/files/current/latest/chef-automate-cli/chef-automate_linux_amd64.zip | gunzip -> chef-automate && chmod +x chef-automate
$ sudo sysctl -w vm.max_map_count=262144
$ sudo sysctl -w vm.dirty_expire_centisecs=20000
/etc/sysctl.conf
so, it persists across reboots. chef-automate
to deploy Automate and Infra Server using product flags. Additionally, you can add --product builder
to install Habitat Builder. $ sudo ./chef-automate deploy --product automate --product infra-server
https://automate.chef.lab
. The Automate login credentials are placed in a file generated in the home directory on your Automate host during installation. $ sudo cat ~/automate-credentials.toml
chef-server-ctl reconfigure
will not work. Instead, edit config.toml
and run chef-automate config patch config.toml
to apply custom changes. akshay.pem
and lab-validator.pem
files. $ sudo chef-server-ctl user-create USER_NAME FIRST_NAME LAST_NAME EMAIL 'PASSWORD' --filename FILE_NAME
$ sudo chef-server-ctl org-create short_name 'full_organization_name' --association_user user_name --filename ORGANIZATION-validator.pem
$ sudo chef-server-ctl user-create akshay Akshay Parvatikar akshay@chef.lab 'password' --filename akshay.pem
$ sudo chef-server-ctl org-create lab 'My Chef Lab' --association_user akshay --filename lab-validator.pem
The steps described here can be automated with a bash script. Update the variables to suit your requirements. Then, save as deploy-automate.sh
on your raw Automate server, run chmod +x deploy-automate.sh
, and execute with ./deploy-automate.sh
.
#!/bin/bash
# Variables – Edit items which are in Bold and Italics
hostname='ec2-54-221-158-169.compute-1.amazonaws.com'
username='akshay'
longusername='Akshay Parvatikar'
useremail='akshay.@chef.com'
userpassword='password'
orgname='lab'
longorgname='My Lab'
# Do not change the two dynamic variables below
userfilename="${username}.pem"
orgfilename="${orgname}-validator.pem"
# Do not change anything below
sudo hostnamectl set-hostname $hostname
sudo sysctl -w vm.max_map_count=262144
sudo sysctl -w vm.dirty_expire_centisecs=20000
curl https://packages.chef.io/files/current/latest/chef-
automate-cli/chef-automate_linux_amd64.zip | gunzip - > chef-
automate && chmod +x chef-automate
sudo ./chef-automate deploy --product automate --product
infra-server --accept-terms-and-mlsa=true
sudo chef-server-ctl user-create $username $longusername
$useremail "${userpassword}" --filename $userfilename
sudo chef-server-ctl org-create $orgname "${longorgname}" --
association_user $username --filename $orgfilename
For Red Hat Enterprise Linux and CentOS:
$ sudo rpm -Uvh /tmp/chef-server-core-<version>.rpm
$ sudo dpkg -i /tmp/chef-server-core-<version>.deb
$ sudo chef-server-ctl reconfigure
$ sudo chef-server-ctl user-create USER_NAME FIRST_NAME LAST_NAME EMAIL 'PASSWORD' --filename FILE_NAME
$ sudo chef-server-ctl org-create short_name 'full_organization_name' --association_user user_name --filename ORGANIZATION-validator.pem
curl https://packages.chef.io/files/current/latest/chef-automate-cli/chef-automate_linux_amd64.zip | gunzip - > chef-automate && chmod +x chef-automate
config.toml
file with default values with the command. $ sudo ./chef-automate init-config
config.toml
file $ sudo sysctl -w vm.max_map_count=262144
$ sudo sysctl -w vm.dirty_expire_centisecs=20000
$ sudo ./chef-automate deploy config.toml
At the end of the deployment process, you will see Deploy Complete
.
Go to Automate UI > settings > automate API > create and copy token
.$ sudo chef-server-ctl set-secret data_collector token '<API_Token>'
$ sudo chef-server-ctl restart nginx
$ sudo chef-server-ctl restart opscode-erchef
chef-server.rb
on Chef Server. data_collector['root_url'] = 'https://<Automate_Server_IP>/data-collector/v0/'
profiles['root_url'] = 'https://<Automate_Server_IP>’
$ chef-server-ctl reconfigure