chef-partners/azure-chef-extension

Runlist conflicts with policy_name and policy_group settings in first-boot.json

gsreynolds opened this issue · 2 comments

Reoccurrence of #211

Providing no run list and using custom_json_attr results in a first run failure:

# Logfile created on 2019-11-18 17:02:43 +0000 by logger.rb/61378
[2019-11-18T17:02:51+00:00] ERROR: Running exception handlers
[2019-11-18T17:02:51+00:00] ERROR: Exception handlers complete
[2019-11-18T17:02:51+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2019-11-18T17:02:51+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2019-11-18T17:02:51+00:00] FATAL: Chef::PolicyBuilder::Policyfile::UnsupportedFeature: Policyfile does not support override run lists. Use named run_lists instead.

Line in question appears to be

command = "chef-client #{first_client_run_recipe_path} -j #{bootstrap_directory}/first-boot.json -c #{bootstrap_directory}/client.rb -L #{@azure_plugin_log_location}/chef-client.log --once"
where the path to first_client_run_recipe.rb is interpreted as a named run list.

Policyfile does not support override run lists. Use named run_lists instead.

e.g. chef-client /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/azure-chef-extension-0.0.1/lib/chef/azure/first_client_run_recipe.rb -j /etc/chef/first-boot.json -c /etc/chef/client.rb

$ cat /etc/chef/first-boot.json
{"policy_group":"testing","policy_name":"base"}

Related #259, as full support for Policyfiles rather than using custom_json_attrs would be preferable.

Looks like first_client_run_recipe.rb was introduced in #255
67ed323#diff-071e0854a12e1a1e26aa93361d1fbacd

Thanks @gsreynolds. We will be working on this and update you once fixed.