Skip to content
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 - Ohai Hints Permission Denied #2781

Closed
phoolish opened this issue Jul 18, 2015 · 2 comments · Fixed by #2793
Closed

Provisioner Chef - Ohai Hints Permission Denied #2781

phoolish opened this issue Jul 18, 2015 · 2 comments · Fixed by #2793

Comments

@phoolish
Copy link
Contributor

I get this error when trying to provision chef with a user other then root:

* Uploading ec2.json failed: scp: /etc/chef/ohai/hints/ec2.json: Permission denied

Here is the provisioner:

provisioner "chef"  {
  environment = "production"
  run_list = ["role[basic]"]
  node_name = "name-stage01"
  server_url = "https://name.com/organizations/name"
  ohai_hints = ["../ec2.json"]
  validation_client_name = "chef-validator"
  validation_key_path = "../../.chef/chef-validator.pem"
  connection {
    user = "ec2-user"
    agent = true
  }
}

NOTE: ec2.json is an empty json file in my local path.

My work around:

provisioner "remote-exec" {
  inline = [
    "sudo mkdir -p /etc/chef/ohai/hints",
    "sudo touch /etc/chef/ohai/ec2.json"
  ]
  connection {
    user = "ec2-user"
    agent = true
  }
}
provisioner "chef"  {
  environment = "production"
  run_list = ["role[basic]"]
  node_name = "name-stage01"
  server_url = "https://name.com/organizations/name"
  validation_client_name = "chef-validator"
  validation_key_path = "../../.chef/chef-validator.pem"
  connection {
    user = "ec2-user"
    agent = true
  }
}
@phoolish
Copy link
Contributor Author

Thanks!

@ghost
Copy link

ghost commented May 1, 2020

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.

@ghost ghost locked and limited conversation to collaborators May 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants