-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from chef-partners/rhass/timeout-debug
Fix Starter Kit Download issues add improvements for debugging.
- Loading branch information
Showing
8 changed files
with
49 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -253,6 +253,7 @@ Resources: | |
- |+ | ||
- - '#!/bin/bash -ex' | ||
- export HOME=/root | ||
- !If | ||
- HasLicenseUrl | ||
- !Sub >- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...arketplace-cookbooks/chef-marketplace/templates/default/biscotti_nginx_upstreams.conf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
upstream biscotti { | ||
server 127.0.0.1:<%= node['chef-marketplace']['biscotti']['port'] %>; | ||
# Disable fail_timeout and max_fails accounting for Unicorn. | ||
# https://git.io/vAzf0 | ||
server 127.0.0.1:<%= node['chef-marketplace']['biscotti']['port'] %> max_fails=0 fail_timeout=0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,34 +77,41 @@ def setup_automate | |
# * determine correct email | ||
# * create user with existing delivery.{pem,pub} | ||
create_user = [ | ||
"chef-server-ctl user-create", | ||
"delivery", # options.username.to_s.shellescape, | ||
"Automate", # options.first_name.to_s.shellescape, | ||
"User", # options.last_name.to_s.shellescape, | ||
"[email protected]", # options.email.to_s.shellescape, | ||
passwords["chef_user"].shellescape, # options.password.to_s.shellescape | ||
"-f /etc/delivery/delivery.pem", | ||
].join(" ") | ||
"chef-server-ctl", | ||
"user-create", | ||
"delivery", # options.username, | ||
"Automate", # options.first_name, | ||
"User", # options.last_name, | ||
"[email protected]", # options.email, | ||
passwords["chef_user"], # options.password | ||
"-f", "/etc/delivery/delivery.pem", | ||
].shelljoin | ||
retry_command(create_user, retries: 1) | ||
|
||
# create chef server org | ||
create_org = [ | ||
"chef-server-ctl org-create", | ||
"delivery", # options.organization.to_s.shellescape, | ||
"delivery", # options.organization.to_s.shellescape, | ||
"-a", | ||
"delivery" # options.username.to_s.shellescape | ||
].join(" ") | ||
"chef-server-ctl", | ||
"org-create", | ||
"delivery", # options.organization, | ||
"delivery", # options.organization, | ||
"-a", "delivery" # options.username | ||
].shelljoin | ||
retry_command(create_org, retries: 1) | ||
|
||
# Try to wait for automate to come up before attempting to create the | ||
# automate enterprise. This has the added bonus of being able to log | ||
# the state of all the services while we wait. | ||
retry_command("delivery-ctl status", retries: 60, seconds: 2) # Wait up to two minutes. | ||
|
||
# create automate enterprise | ||
create_ent = [ | ||
"delivery-ctl create-enterprise", | ||
"delivery-ctl", | ||
"create-enterprise", | ||
"default", # enterprise name | ||
"--ssh-pub-key-file=/etc/delivery/builder.pub", # builder public key | ||
"--password=#{passwords['admin_user'].shellescape}", # admin password | ||
"--builder-password=#{passwords['builder_user'].shellescape}" # builder password | ||
].join(" ") | ||
"--password=#{passwords['admin_user']}", # admin password | ||
"--builder-password=#{passwords['builder_user']}" # builder password | ||
].shelljoin | ||
retry_command(create_ent, retries: 3, seconds: 10) | ||
end | ||
|
||
|
@@ -367,6 +374,7 @@ def retry_command(cmd, retries: 5, seconds: 2, env: {}) | |
retries.times do | ||
command = Mixlib::ShellOut.new(cmd) | ||
command.environment = env unless env.empty? | ||
command.live_stream = STDOUT if options.debug | ||
command.run_command | ||
return unless command.error? | ||
ui.say("#{cmd} failed, retrying...") | ||
|