Skip to content

Instantly share code, notes, and snippets.

@ericcalabretta
Last active April 29, 2020 19:04
Show Gist options
  • Save ericcalabretta/23fe5df610993cbd217e34141604e73d to your computer and use it in GitHub Desktop.
Save ericcalabretta/23fe5df610993cbd217e34141604e73d to your computer and use it in GitHub Desktop.
Pilot Automate + Chef Server install

Step 1: Set up Chef Automate & Chef Server

Downloads the automate deployment cli curl https://packages.chef.io/files/current/latest/chef-automate-cli/chef-automate_linux_amd64.zip | gunzip - > chef-automate && chmod +x chef-automate

Generate a config file:

sudo ./chef-automate init-config

Make sure fqdn = "yourFQDN" It'll pull this from the system hostname by default

You must also configure license = "" with the your Chef Automate license key.

The Chef Automate preflight-check may require you to change a few settings prior to deployment. Change as appropriate, the neccesary commands are in the preflight-check output. Like this:

Fix the system tuning failures indicated above by running the following:
sysctl -w vm.max_map_count=262144
sysctl -w vm.dirty_expire_centisecs=20000

To make these changes permanent, add the following to /etc/sysctl.conf:
vm.max_map_count=262144
vm.dirty_expire_centisecs=20000

Deploy chef automate & chef server:

sudo ./chef-automate deploy --product automate --product chef-server config.toml --airgap-bundle </path/to/airgap-install-bundle>

Accept the Chef Automate license agreement with yes when prompted.

Grab the generated admin password & login to the web interface

Now we have a Chef-Automate deployed you can find the generated admin password in the `automate-credentials.toml file

Step 2: configure chef-server

Next lets configure chef-server. We'll create a username, an organization to store our cookbooks and downlaod some keys.

sudo chef-server-ctl user-create ericc eric c ericc@example.com 'PasswordGoesHere' --filename /tmp/ericc.pem

sudo chef-server-ctl org-create demo-org 'demo org' --association_user ericc --filename /tmp/validator.pem

Keep the two .pem files we generated, we'll need them later.

We'll also change a configuration setting so we can send larger compliance reports.

make a file called size.toml the name can be anything but the extension must be .toml

[erchef]
  [erchef.v1]
    [erchef.v1.sys]
      [erchef.v1.sys.api]
        max_request_size = 2000000

Now apply the config change with:

sudo chef-automate config patch size.toml

You can validate the configuration is correct with:

sudo chef-automate config show

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment