Closed sogos closed 3 years ago
If I put a value directly in config for roles_path and not in command line variable like:
"{{user `chef_roles_path`}}"
the directory is inspected before the run and roles are well uploaded
So the bug is : we can't provide roles_path as User var from command line
Thanks
Thanks for clarifying the failure case here. You might be able to hack around this problem by customizing the execute_command
. Another approach is to generate that part of the template using python, ruby, or sed before you run the build.
Thanks, it's a good idea for the moment
I can add that "environments_path" also don't work when User var
Hi @sogos, hi @cbednarski,
I've been running into the same problem recently. I'm using packer version 1.0.4, but it also seems to fail in 1.4.0. Here is my template file:
{
"variables": {
"export_path": "{{env `DOCKER_IMAGE_PATH`}}",
"chefdk_version": "{{env `CHEFDK_VERSION`}}",
"chef_path": "{{env `CHEF_PATH`}}"
},
"builders": [
{
"name": "docker-container",
"type": "docker",
"image": "ubuntu:bionic",
"export_path": "{{user `export_path`}}"
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"apt-get update",
"DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends curl sudo ca-certificates dnsutils"
]
},
{
"type": "chef-solo",
"install_command": "curl -L https://omnitruck.chef.io/install.sh | sudo bash -s -- -P chefdk -c stable -v {{user `chefdk_version`}}",
"cookbook_paths": [
"/home/vagrant/repo/tools/chef/berks-cookbooks",
"/home/vagrant/repo/tools/chef/cookbooks"
],
"roles_path": "/home/vagrant/repo/tools/chef/roles",
"run_list": [
"role[common]"
]
}
]
}
The roles directory contains a file called common.json, but it seems like this file is not uploaded to the container before chef is being executed.
Hello folks, thanks for opening up this issue. Apologies that we've not had the chance to dive further into this issue. If you've managed to resolve your problem we encourage you to leave comment for others who may experience this issue in the future.
With that said, this is one of our community maintained plugins, which we have recently flagged as unmaintained. If you are interested in contributing or taking ownership of this plugin, please reach out to us at packer@hashicorp.com.
This issue has been automatically migrated to hashicorp/packer-plugin-chef#16 because it looks like an issue with that plugin. If you believe this is not an issue with the plugin, please reply to hashicorp/packer-plugin-chef#16.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
When i use this snippet
The solo.rb is not filled with roles_path and role directory is not uploaded to staging_directory
I use "packer_0.9.0_darwin_amd64"
Thanks