Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
0eb634ae
Commit
0eb634ae
authored
Nov 26, 2014
by
Seth Vargo
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1525 from scott2449/master
Add default nodename for chef-client
parents
1954cc97
4383b435
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
+10
-11
provisioner/chef-client/provisioner.go
provisioner/chef-client/provisioner.go
+5
-2
website/source/docs/provisioners/chef-client.html.markdown
website/source/docs/provisioners/chef-client.html.markdown
+5
-9
No files found.
provisioner/chef-client/provisioner.go
View file @
0eb634ae
...
...
@@ -14,6 +14,7 @@ import (
"strings"
"github.com/mitchellh/packer/common"
"github.com/mitchellh/packer/common/uuid"
"github.com/mitchellh/packer/packer"
)
...
...
@@ -187,7 +188,11 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
}
func
(
p
*
Provisioner
)
Provision
(
ui
packer
.
Ui
,
comm
packer
.
Communicator
)
error
{
nodeName
:=
p
.
config
.
NodeName
if
nodeName
==
""
{
nodeName
=
fmt
.
Sprintf
(
"packer-%s"
,
uuid
.
TimeOrderedUUID
())
}
remoteValidationKeyPath
:=
""
serverUrl
:=
p
.
config
.
ServerUrl
...
...
@@ -553,9 +558,7 @@ validation_client_name "chef-validator"
{{if ne .ValidationKeyPath ""}}
validation_key "{{.ValidationKeyPath}}"
{{end}}
{{if ne .NodeName ""}}
node_name "{{.NodeName}}"
{{end}}
{{if ne .ChefEnvironment ""}}
environment "{{.ChefEnvironment}}"
{{end}}
...
...
website/source/docs/provisioners/chef-client.html.markdown
View file @
0eb634ae
...
...
@@ -29,14 +29,14 @@ remote machine and run Chef client.
}
```
Note: to properly clean up the Chef node and client, you must have
`knife`
on your path and properly configured.
Note: to properly clean up the Chef node and client the machine on which
packer is running must have knife on the path and configured globally,
i.e, ~/.chef/knife.rb must be present and configured for the target chef server
## Configuration Reference
The reference of available configuration options is listed below. No
configuration is actually required, but
`node_name`
is recommended
since it will allow the provisioner to clean up the node/client.
configuration is actually required.
*
`chef_environment`
(string) - The name of the chef_environment sent to the
Chef server. By default this is empty and will not use an environment.
...
...
@@ -60,8 +60,7 @@ since it will allow the provisioner to clean up the node/client.
node attributes while running Chef.
*
`node_name`
(string) - The name of the node to register with the Chef
Server. This is optional and by defalt is empty. If you don't set this,
Packer can't clean up the node from the Chef Server using knife.
Server. This is optional and by default is packer-{{uuid}}.
*
`prevent_sudo`
(boolean) - By default, the configured commands that are
executed to install and run Chef are executed with
`sudo`
. If this is true,
...
...
@@ -78,7 +77,6 @@ since it will allow the provisioner to clean up the node/client.
*
`skip_clean_node`
(boolean) - If true, Packer won't remove the node
from the Chef server after it is done running. By default, this is false.
This will be true by default if
`node_name`
is not set.
*
`skip_install`
(boolean) - If true, Chef will not automatically be installed
on the machine using the Opscode omnibus installers.
...
...
@@ -116,9 +114,7 @@ validation_client_name "chef-validator"
{{
if
ne
.
ValidationKeyPath
""
}}
validation_key "
{{.
ValidationKeyPath
}}
"
{{
end
}}
{{
if
ne
.
NodeName
""
}}
node_name "
{{.
NodeName
}}
"
{{
end
}}
```
This template is a
[
configuration template
](
/docs/templates/configuration-templates.html
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment