Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Run Cookbook with Chef Run

  1. Spin up a new Linux machine on AWS
  2. Create the wrapper cookbook
# prepare the basic structure of wrapper cookbook
mkdir -p run
mkdir -p run/recipes

# create metadata
cat > run/metadata.rb << EOF
name 'run'
depends "mondoo"

# create recipe
cat > run/recipes/default.rb << EOF
# mitigate utf8 bug in Chef, where it fails to call `package` on a fresh instance
ENV['LANG'] = 'en_US.utf-8'
ENV['LC_ALL'] = 'en_US.utf-8'

# include chef recipe
include_recipe 'mondoo::default'

cat > run/Policyfile.rb << EOF
name "run"

run_list "run::default"

default_source :supermarket
cookbook "mondoo"
cookbook "run", path: './'

default['mondoo']['registration_token'] = "changeme"
  1. Run

Now we are ready to apply the cookbook to a remote instance:

chef-run ssh://ec2-user@ ./run


You can’t perform that action at this time.