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
525802e9
Commit
525802e9
authored
Dec 27, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
provisioner/ansible-local: templates for role, playbook paths [GH-749]
parent
77d0d63b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
CHANGELOG.md
CHANGELOG.md
+2
-0
provisioner/ansible-local/provisioner.go
provisioner/ansible-local/provisioner.go
+18
-1
No files found.
CHANGELOG.md
View file @
525802e9
...
...
@@ -66,6 +66,8 @@ BUG FIXES:
*
builder/virtualbox: don't download guest additions if disabled. [GH-731]
*
post-processor/vsphere: Uploads VM properly. [GH-694]
*
post-processor/vsphere: Process user variables.
*
provisioner/ansible-local: all configurations are processed as templates
[GH-749]
*
provisioner/ansible-local: playbook paths are properly validated
as directories, not files. [GH-710]
*
provisioner/chef-solo: Environments are recognized. [GH-726]
...
...
provisioner/ansible-local/provisioner.go
View file @
525802e9
...
...
@@ -54,7 +54,8 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
// Templates
templates
:=
map
[
string
]
*
string
{
"staging_dir"
:
&
p
.
config
.
StagingDir
,
"playbook_file"
:
&
p
.
config
.
PlaybookFile
,
"staging_dir"
:
&
p
.
config
.
StagingDir
,
}
for
n
,
ptr
:=
range
templates
{
...
...
@@ -66,6 +67,22 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
}
}
sliceTemplates
:=
map
[
string
][]
string
{
"playbook_paths"
:
p
.
config
.
PlaybookPaths
,
"role_paths"
:
p
.
config
.
RolePaths
,
}
for
n
,
slice
:=
range
sliceTemplates
{
for
i
,
elem
:=
range
slice
{
var
err
error
slice
[
i
],
err
=
p
.
config
.
tpl
.
Process
(
elem
,
nil
)
if
err
!=
nil
{
errs
=
packer
.
MultiErrorAppend
(
errs
,
fmt
.
Errorf
(
"Error processing %s[%d]: %s"
,
n
,
i
,
err
))
}
}
}
// Validation
err
=
validateFileConfig
(
p
.
config
.
PlaybookFile
,
"playbook_file"
,
true
)
if
err
!=
nil
{
...
...
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