Skip to content

Commit

Permalink
Set HOME environment variable on initial startup.
Browse files Browse the repository at this point in the history
`automate-ctl create-enterprise` is called via the marketplace gem and
chef-marketplace-ctl. We execute the chef-marketplace-ctl commands
automatically on first boot with the `--preconfigure` flag to configure
the Chef Automate and Chef Server products, as well as allow users to
configure their credentials via the biscotti interface. The
`chef-marketplace-ctl` command calls `automate-ctl`, which calls an escript
`enterprise_ctl` which requires the environment variable `HOME` to be
defined as a valid path. This ensures we set a value and allows the
enterprise to be created.

Fixes SUSTAIN-844 #comment Set $HOME environment variable to prevent
`delivery-ctl create-enterprise default` from failing.

Signed-off-by: Ryan Hass <[email protected]>
  • Loading branch information
rhass committed Mar 17, 2018
1 parent 1d813c7 commit 4d6a136
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arm-templates/automate/automate_setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@
config.puts(%Q{api_fqdn "#{@fqdn}"})
end

environment = {
'HOME' => '/root'
}

# Configure the hostname
hostname = Mixlib::ShellOut.new("chef-marketplace-ctl hostname #{@fqdn}")
hostname = Mixlib::ShellOut.new("chef-marketplace-ctl hostname #{@fqdn}", env: environment)
hostname.run_command

# Configure Automate
configure = Mixlib::ShellOut.new("chef-marketplace-ctl setup --preconfigure")
configure = Mixlib::ShellOut.new("chef-marketplace-ctl setup --preconfigure", env: environment)
configure.run_command
1 change: 1 addition & 0 deletions cloudformation/marketplace_byol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ Resources:
- |+
- - '#!/bin/bash -ex'
- export HOME=/root
- !If
- HasLicenseUrl
- !Sub >-
Expand Down

0 comments on commit 4d6a136

Please sign in to comment.