Skip to content

Commit

Permalink
override reconfigure command to accept chef license
Browse files Browse the repository at this point in the history
By adding a `reconfigure` command to the `general` category, we can
override the one provided by omnibus-ctl that performs license checking
for a project. It was decided that the use of chef-client within
Supermarket's -ctl commands was a "library use," so a non-persistent
acceptance at the call sites is acceptable.

This reconfigure command looks much like omnibus-ctl's, but with the
license review and acceptance removed. This command still uses the
`run_chef` method and passes in the non-persistent acceptance as an
argument.

This change also updates omnibus-ctl because it was woefully behind.

Signed-off-by: Robb Kidd <[email protected]>
  • Loading branch information
robbkidd committed Aug 20, 2019
1 parent efe1365 commit 3940d2c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions omnibus/config/projects/supermarket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
override :bundler, version: "1.17.3" # this must match the BUNDLED WITH in all the repo's Gemfile.locks
override :'chef-gem', version: '14.5.33'
override :'openssl-fips', version: '2.0.16'
override :'omnibus-ctl', version: 'master'

# Creates required build directories
dependency "preparation"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require 'mixlib/shellout'

add_command_under_category 'reconfigure', 'general', 'Reconfigure the application.', 2 do
status = run_chef("#{base_path}/embedded/cookbooks/dna.json", '--chef-license=accept-no-persist')
if status.success?
log "#{display_name} Reconfigured!"
exit! 0
else
exit! 1
end
end

0 comments on commit 3940d2c

Please sign in to comment.