-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
provisioner/chef: node is deleted when recreate_client=true
#13529
Comments
Provisioning is synonymous to bootstrapping, which means you need to have no node or client far as I know. The documentation also notes that it is not very useful:
Generally speaking I'd use the provider to interact with only Why not just use the provisioner? It can set the Your config, without the resource "null_resource" "hyperv03" {
connection {
type = "winrm"
user = "vagrant"
password = "vagrant"
host = "192.168.33.11"
}
provisioner "chef" {
environment = ""${chef_environment.dev.name}"
run_list = ["recipe[chef-client::delete_validation]","recipe[chef-client::windows_service]"]
node_name = "hyperv03"
os_type = "windows"
server_url = "https://api.chef.io/organizations/my_org"
recreate_client = "true"
skip_install = "true"
user_name = "user"
user_key = "${file(".chef/user.pem")}"
}
provisioner "local-exec" {
when = "destroy"
command = "knife node delete hyperv03 -y; knife client delete hyperv03 -y"
}
} There's the other matter of why you're doing this in a I'm also assuming due to sanitization you have If you are looking for terraform guidance there's the chef community slack and a terraform channel where you can go seek out for input. |
@mengesb Thanks a lot for your answer, really appreciate. |
I will close this issue. It doesn't make much sense until |
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. |
Actually this is not bug but feature request.
I'm trying to completely replace
knife bootstrap
workflow with declarative description of this process withterraform
.For new workflow i'm trying to use
null_resource
,chef
provisioner andchef_node
resource fromchef
provider.So the problem is when i first create node with
chef_node
, the next run ofchef
provisioner re-create node.https://github.com/hashicorp/terraform/blob/master/builtin/provisioners/chef/resource_provisioner.go#L529
Why we should delete node if
recreate_client=true
? Why not just create only client?Maybe something like
skip_node_deletion
?Terraform Version
Terraform v0.9.2
Affected Resource(s)
Please list the resources as a list, for example:
Expected Behavior
chef
provisioner should only creates client but skip node deletion if node is already present.Actual Behavior
chef
provisioner deletes node.References
The text was updated successfully, but these errors were encountered: