-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Chef Provisioner - Invalid Private Key #18461
Comments
In case anyone else is experiencing similar issues, for now my workaround has being running # Sleep because local-exec was running before ssh was started newly created instances.
provisioner "local-exec" {
command = "sleep 10s"
}
provisioner "local-exec" {
command = "cd ${var.knife_path} && knife node delete ${aws_instance.bastion_server.tags.Name} -y && knife client delete ${aws_instance.bastion_server.tags.Name} -y || true"
}
provisioner "local-exec" {
command = "cd ${var.knife_path} && knife bootstrap ${aws_instance.bastion_server.public_ip} -N ${aws_instance.bastion_server.tags.Name} -r 'role[bastion]' -x ubuntu -i ${var.provisioner_key} --sudo"
}
provisioner "local-exec" {
command = "cd ${var.knife_path} && knife node run_list add ${aws_instance.bastion_server.tags.Name} 'role[bastion]'"
} |
This issue has been automatically migrated to hashicorp/terraform-provider-chef#24 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to hashicorp/terraform-provider-chef#24. |
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. |
Terraform Version
Terraform Configuration Files
Expected Behavior
Chef should have bootstrapped the node.
Actual Behavior
Additionally on the server the contents of
/etc/chef/
are the following:contents of
client.rb
are:If I add the correct key to /etc/chef/validator.pem & edit the client.rb file to look like the following,
sudo chef-client
works and connects to the chef server:Steps to Reproduce
terraform init
terraform apply
Additional Context
References
The text was updated successfully, but these errors were encountered: