launch_debug.sh 966 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/usr/bin/env bash
  2. ./scripts/export_policy.sh $@
  3. # Setup the configuration file
  4. cat << _EOF > policy-export/.chef/config_solo.rb
  5. log_level :debug
  6. log_location '/dev/null'
  7. ssl_verify_mode :verify_none
  8. file_cache_path "./.chef/local-mode-cache/cache/cookbooks"
  9. cookbook_path ["./cookbook_artifacts"]
  10. # Mixlib::Log::Formatter.show_time specifies whether the log should
  11. # contain timestamps.
  12. # valid values are true or false. The printed timestamp is rfc2822, for example:
  13. # Fri, 31 Jul 2009 19:19:46 -0600
  14. Mixlib::Log::Formatter.show_time = true
  15. _EOF
  16. cd policy-export
  17. mkdir -p nodes
  18. # Create the node
  19. cat << _EOF > "./nodes/$(hostname --fqdn).json"
  20. {
  21. "name": "Thinkpad-vhdx.",
  22. "chef_environment": "local",
  23. "normal": {
  24. "tags": [
  25. ]
  26. },
  27. "run_list": [
  28. "recipe[workstation::default]"
  29. ],
  30. "policy_name": "base",
  31. "policy_group": "local"
  32. }
  33. _EOF
  34. bundle exec chef-shell -s -c .chef/config_solo.rb
  35. cd -
  36. ./scripts/end_run.sh