123456789101112131415161718192021222324252627282930313233343536373839 |
- #!/usr/bin/env bash
- ./scripts/export_policy.sh $@
- # Setup the configuration file
- cat << _EOF > policy-export/.chef/config_solo.rb
- log_level :debug
- log_location '/dev/null'
- ssl_verify_mode :verify_none
- file_cache_path "./.chef/local-mode-cache/cache/cookbooks"
- cookbook_path ["./cookbook_artifacts"]
- # Mixlib::Log::Formatter.show_time specifies whether the log should
- # contain timestamps.
- # valid values are true or false. The printed timestamp is rfc2822, for example:
- # Fri, 31 Jul 2009 19:19:46 -0600
- Mixlib::Log::Formatter.show_time = true
- _EOF
- cd policy-export
- mkdir -p nodes
- # Create the node
- cat << _EOF > "./nodes/$(hostname --fqdn).json"
- {
- "name": "Thinkpad-vhdx.",
- "chef_environment": "local",
- "normal": {
- "tags": [
- ]
- },
- "run_list": [
- "recipe[workstation::default]"
- ],
- "policy_name": "base",
- "policy_group": "local"
- }
- _EOF
- bundle exec chef-shell -s -c .chef/config_solo.rb
- cd -
- ./scripts/end_run.sh
|