Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #5 from isaoshimizu/add_legacy_mode
Browse files Browse the repository at this point in the history
Add option chef_legacy_mode
  • Loading branch information
hirocaster committed Jun 14, 2016
2 parents b369269 + 82fbf7e commit e6e0d48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -117,6 +117,7 @@ Following options are available.
* `:chef_roles_auto_discovery` - Enable "Chef roles Auto discovery". use `false` by default.
* `:chef_verbose_logging`, - Enable verbose logging mode of `chef-solo`. use `true` by default.
* `:chef_debug` - Enable debug mode of `chef-solo`. use `false` by default.
* `:chef_legacy_mode` - Enable legacy mode of `chef-solo`. use `false` by default. In Chef 12.11.18 or later is recommended `true`.

* Settings for directories

Expand Down
5 changes: 3 additions & 2 deletions lib/capistrano-paratrooper-chef/chef.rb
Expand Up @@ -45,6 +45,7 @@
}

# chef settings
set :chef_legacy_mode, false
set :chef_roles_auto_discovery, false
set :chef_verbose_logging, true
set :chef_debug, false
Expand Down Expand Up @@ -236,7 +237,7 @@ def generate_solo_json
desc "Run chef-solo"
task :execute do
logger.info "Now running chef-solo"
command = "#{chef_solo_path} -c #{remote_path("solo.rb")} -j #{remote_path("solo.json")}#{' -l debug' if fetch(:chef_debug)}"
command = "#{chef_solo_path} -c #{remote_path("solo.rb")} -j #{remote_path("solo.json")}#{' --legacy-mode' if fetch(:chef_legacy_mode)}#{' -l debug' if fetch(:chef_debug)}"
if run_list.unique?
sudo command
else
Expand All @@ -250,7 +251,7 @@ def generate_solo_json
desc "why-run chef-solo"
task :execute_why_run do
logger.info "Now running why-run chef-solo"
command = "#{chef_solo_path} -c #{remote_path("solo.rb")} -j #{remote_path("solo.json")} -l fatal --why-run"
command = "#{chef_solo_path} -c #{remote_path("solo.rb")} -j #{remote_path("solo.json")}#{' --legacy-mode' if fetch(:chef_legacy_mode)} -l fatal --why-run"
if run_list.unique?
sudo command
else
Expand Down

0 comments on commit e6e0d48

Please sign in to comment.