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
fd6415dd
Commit
fd6415dd
authored
Oct 01, 2013
by
Chris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
formatting
parent
bc8e5d2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
provisioner/chef-solo/provisioner.go
provisioner/chef-solo/provisioner.go
+22
-22
No files found.
provisioner/chef-solo/provisioner.go
View file @
fd6415dd
...
@@ -41,19 +41,19 @@ type Provisioner struct {
...
@@ -41,19 +41,19 @@ type Provisioner struct {
}
}
type
ConfigTemplate
struct
{
type
ConfigTemplate
struct
{
CookbookPaths
string
CookbookPaths
string
DataBagsPath
string
DataBagsPath
string
RolesPath
string
RolesPath
string
EnvironmentsPath
string
EnvironmentsPath
string
ChefEnvironment
string
ChefEnvironment
string
// Templates don't support boolean statements until Go 1.2. In the
// Templates don't support boolean statements until Go 1.2. In the
// mean time, we do this.
// mean time, we do this.
// TODO(mitchellh): Remove when Go 1.2 is released
// TODO(mitchellh): Remove when Go 1.2 is released
HasDataBagsPath
bool
HasDataBagsPath
bool
HasRolesPath
bool
HasRolesPath
bool
HasEnvironmentsPath
bool
HasEnvironmentsPath
bool
HasChefEnvironment
bool
HasChefEnvironment
bool
}
}
type
ExecuteTemplate
struct
{
type
ExecuteTemplate
struct
{
...
@@ -98,12 +98,12 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
...
@@ -98,12 +98,12 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
errs
:=
common
.
CheckUnusedConfig
(
md
)
errs
:=
common
.
CheckUnusedConfig
(
md
)
templates
:=
map
[
string
]
*
string
{
templates
:=
map
[
string
]
*
string
{
"config_template"
:
&
p
.
config
.
ConfigTemplate
,
"config_template"
:
&
p
.
config
.
ConfigTemplate
,
"data_bags_path"
:
&
p
.
config
.
DataBagsPath
,
"data_bags_path"
:
&
p
.
config
.
DataBagsPath
,
"roles_path"
:
&
p
.
config
.
RolesPath
,
"roles_path"
:
&
p
.
config
.
RolesPath
,
"staging_dir"
:
&
p
.
config
.
StagingDir
,
"staging_dir"
:
&
p
.
config
.
StagingDir
,
"environments_path"
:
&
p
.
config
.
EnvironmentsPath
,
"environments_path"
:
&
p
.
config
.
EnvironmentsPath
,
"chef_environment"
:
&
p
.
config
.
ChefEnvironment
,
"chef_environment"
:
&
p
.
config
.
ChefEnvironment
,
}
}
for
n
,
ptr
:=
range
templates
{
for
n
,
ptr
:=
range
templates
{
...
@@ -319,14 +319,14 @@ func (p *Provisioner) createConfig(ui packer.Ui, comm packer.Communicator, local
...
@@ -319,14 +319,14 @@ func (p *Provisioner) createConfig(ui packer.Ui, comm packer.Communicator, local
}
}
configString
,
err
:=
p
.
config
.
tpl
.
Process
(
tpl
,
&
ConfigTemplate
{
configString
,
err
:=
p
.
config
.
tpl
.
Process
(
tpl
,
&
ConfigTemplate
{
CookbookPaths
:
strings
.
Join
(
cookbook_paths
,
","
),
CookbookPaths
:
strings
.
Join
(
cookbook_paths
,
","
),
RolesPath
:
rolesPath
,
RolesPath
:
rolesPath
,
DataBagsPath
:
dataBagsPath
,
DataBagsPath
:
dataBagsPath
,
EnvironmentsPath
:
environmentsPath
,
EnvironmentsPath
:
environmentsPath
,
HasRolesPath
:
rolesPath
!=
""
,
HasRolesPath
:
rolesPath
!=
""
,
HasDataBagsPath
:
dataBagsPath
!=
""
,
HasDataBagsPath
:
dataBagsPath
!=
""
,
HasEnvironmentsPath
:
environmentsPath
!=
""
,
HasEnvironmentsPath
:
environmentsPath
!=
""
,
ChefEnvironment
:
chefEnvironment
,
ChefEnvironment
:
chefEnvironment
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
...
...
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