Skip to content

Commit 4d6a136

Browse files
committed
Set HOME environment variable on initial startup.
`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]>
1 parent 1d813c7 commit 4d6a136

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

arm-templates/automate/automate_setup.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@
3232
config.puts(%Q{api_fqdn "#{@fqdn}"})
3333
end
3434

35+
environment = {
36+
'HOME' => '/root'
37+
}
38+
3539
# Configure the hostname
36-
hostname = Mixlib::ShellOut.new("chef-marketplace-ctl hostname #{@fqdn}")
40+
hostname = Mixlib::ShellOut.new("chef-marketplace-ctl hostname #{@fqdn}", env: environment)
3741
hostname.run_command
3842

3943
# Configure Automate
40-
configure = Mixlib::ShellOut.new("chef-marketplace-ctl setup --preconfigure")
44+
configure = Mixlib::ShellOut.new("chef-marketplace-ctl setup --preconfigure", env: environment)
4145
configure.run_command

cloudformation/marketplace_byol.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ Resources:
253253
- |+
254254
255255
- - '#!/bin/bash -ex'
256+
- export HOME=/root
256257
- !If
257258
- HasLicenseUrl
258259
- !Sub >-

0 commit comments

Comments
 (0)