hashicorp / packer-plugin-chef

This Packer provisioner is no longer being maintained and has been archived. Users are encouraged to use the shell or shell-local provisioner to run the provisioning tools made available by this plugin. If interested in maintaining this plugin please reach out to us at packer@hashicorp.com.
https://www.packer.io/docs/provisioners/chef-solo
Mozilla Public License 2.0
0 stars 6 forks source link

[Chef-solo] roles_path is ignored by chef-solo provisionner #16

Open ghost opened 3 years ago

ghost commented 3 years ago

This issue was originally opened by @sogos as hashicorp/packer#3298. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


When i use this snippet

{
    "type": "chef-solo",
    "install_command": "curl -L https://www.chef.io/chef/install.sh | {{if .Sudo}}sudo {{end}}bash -s -- -v 12.6.0",
    "cookbook_paths": ["{{user `cookbook_paths`}}"],
    "environments_path": "{{user `environments_path`}}",
    "roles_path":  "{{user `chef_roles_path`}}",
    "data_bags_path": "{{user `data_bags_path`}}",
    "encrypted_data_bag_secret_path": "{{user `encrypted_data_bag_secret_path`}}",
    "chef_environment": "build",
    "run_list": ["role[webserver]"]
}

The solo.rb is not filled with roles_path and role directory is not uploaded to staging_directory

    virtualbox-iso: Creating directory: /tmp/packer-chef-solo
    virtualbox-iso: Creating directory: /tmp/packer-chef-solo/cookbooks-0
    virtualbox-iso: Creating directory: /tmp/packer-chef-solo/data_bags
    virtualbox-iso: Creating configuration file 'solo.rb'
    virtualbox-iso: Creating JSON attribute file
    virtualbox-iso: Executing Chef: sudo chef-solo --no-color -c /tmp/packer-chef-solo/solo.rb -j /tmp/packer-chef-solo/node.json
    virtualbox-iso: [2016-03-01T16:34:45+01:00] INFO: Forking chef instance to converge...
    virtualbox-iso: [2016-03-01T16:34:45+01:00] INFO: *** Chef 12.6.0 ***
    virtualbox-iso: [2016-03-01T16:34:45+01:00] INFO: Chef-client pid: 1312
    virtualbox-iso: [2016-03-01T16:34:47+01:00] INFO: Setting the run_list to ["role[ugo-vm]"] from CLI options
    virtualbox-iso: [2016-03-01T16:34:47+01:00] ERROR: Role webserver (included by 'top level') is in the runlist but does not exist. Skipping expand.

I use "packer_0.9.0_darwin_amd64"

Thanks

nywilken commented 2 years ago

With the archival of this repository all open issues will be marked as read-only. If you wish to further discuss this plugin or any of its open issues we invite you to open a discussion on the Packer community forum.

More details on the plugin archiving process for this provisioner can be found on the Plans to Archive Unmaintained Packer Provisioner Plugins blog post.