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
a6375568
Commit
a6375568
authored
Dec 08, 2014
by
Seth Vargo
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1727 from timurb/add-verify_peer
added ssl_verify_mode parameter to chef-client provisioner
parents
2dace054
e4c544b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
provisioner/chef-client/provisioner.go
provisioner/chef-client/provisioner.go
+9
-2
No files found.
provisioner/chef-client/provisioner.go
View file @
a6375568
...
...
@@ -22,6 +22,7 @@ type Config struct {
common
.
PackerConfig
`mapstructure:",squash"`
ChefEnvironment
string
`mapstructure:"chef_environment"`
SslVerifyMode
string
`mapstructure:"ssl_verify_mode"`
ConfigTemplate
string
`mapstructure:"config_template"`
ExecuteCommand
string
`mapstructure:"execute_command"`
InstallCommand
string
`mapstructure:"install_command"`
...
...
@@ -50,6 +51,7 @@ type ConfigTemplate struct {
ValidationKeyPath
string
ValidationClientName
string
ChefEnvironment
string
SslVerifyMode
string
}
type
ExecuteTemplate
struct
{
...
...
@@ -79,6 +81,7 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
templates
:=
map
[
string
]
*
string
{
"chef_environment"
:
&
p
.
config
.
ChefEnvironment
,
"ssl_verify_mode"
:
&
p
.
config
.
SslVerifyMode
,
"config_template"
:
&
p
.
config
.
ConfigTemplate
,
"node_name"
:
&
p
.
config
.
NodeName
,
"staging_dir"
:
&
p
.
config
.
StagingDir
,
...
...
@@ -214,7 +217,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
}
configPath
,
err
:=
p
.
createConfig
(
ui
,
comm
,
nodeName
,
serverUrl
,
remoteValidationKeyPath
,
p
.
config
.
ValidationClientName
,
p
.
config
.
ChefEnvironment
)
ui
,
comm
,
nodeName
,
serverUrl
,
remoteValidationKeyPath
,
p
.
config
.
ValidationClientName
,
p
.
config
.
ChefEnvironment
,
p
.
config
.
SslVerifyMode
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"Error creating Chef config file: %s"
,
err
)
}
...
...
@@ -268,7 +271,7 @@ func (p *Provisioner) uploadDirectory(ui packer.Ui, comm packer.Communicator, ds
return
comm
.
UploadDir
(
dst
,
src
,
nil
)
}
func
(
p
*
Provisioner
)
createConfig
(
ui
packer
.
Ui
,
comm
packer
.
Communicator
,
nodeName
string
,
serverUrl
string
,
remoteKeyPath
string
,
validationClientName
string
,
chefEnvironment
string
)
(
string
,
error
)
{
func
(
p
*
Provisioner
)
createConfig
(
ui
packer
.
Ui
,
comm
packer
.
Communicator
,
nodeName
string
,
serverUrl
string
,
remoteKeyPath
string
,
validationClientName
string
,
chefEnvironment
string
,
sslVerifyMode
string
)
(
string
,
error
)
{
ui
.
Message
(
"Creating configuration file 'client.rb'"
)
// Read the template
...
...
@@ -294,6 +297,7 @@ func (p *Provisioner) createConfig(ui packer.Ui, comm packer.Communicator, nodeN
ValidationKeyPath
:
remoteKeyPath
,
ValidationClientName
:
validationClientName
,
ChefEnvironment
:
chefEnvironment
,
SslVerifyMode
:
sslVerifyMode
,
})
if
err
!=
nil
{
return
""
,
err
...
...
@@ -574,4 +578,7 @@ node_name "{{.NodeName}}"
{{if ne .ChefEnvironment ""}}
environment "{{.ChefEnvironment}}"
{{end}}
{{if ne .SslVerifyMode ""}}
ssl_verify_mode :{{.SslVerifyMode}}
{{end}}
`
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