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
3a8e0211
Commit
3a8e0211
authored
Nov 25, 2014
by
Emil Hessman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
post-processor/vagrant: process templates in Configure
parent
1de1350e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
post-processor/vagrant/post-processor.go
post-processor/vagrant/post-processor.go
+13
-8
No files found.
post-processor/vagrant/post-processor.go
View file @
3a8e0211
...
...
@@ -113,14 +113,8 @@ func (p *PostProcessor) PostProcessProvider(name string, provider Provider, ui p
// Write our Vagrantfile
var
customVagrantfile
string
if
config
.
VagrantfileTemplate
!=
""
{
vagrantfilePath
,
err
:=
config
.
tpl
.
Process
(
config
.
VagrantfileTemplate
,
nil
)
if
err
!=
nil
{
return
nil
,
false
,
err
}
ui
.
Message
(
fmt
.
Sprintf
(
"Using custom Vagrantfile: %s"
,
vagrantfilePath
))
customBytes
,
err
:=
ioutil
.
ReadFile
(
vagrantfilePath
)
ui
.
Message
(
fmt
.
Sprintf
(
"Using custom Vagrantfile: %s"
,
config
.
VagrantfileTemplate
))
customBytes
,
err
:=
ioutil
.
ReadFile
(
config
.
VagrantfileTemplate
)
if
err
!=
nil
{
return
nil
,
false
,
err
}
...
...
@@ -200,6 +194,17 @@ func (p *PostProcessor) configureSingle(config *Config, raws ...interface{}) err
// Accumulate any errors
errs
:=
common
.
CheckUnusedConfig
(
md
)
templates
:=
map
[
string
]
*
string
{
"vagrantfile_template"
:
&
config
.
VagrantfileTemplate
,
}
for
key
,
ptr
:=
range
templates
{
*
ptr
,
err
=
config
.
tpl
.
Process
(
*
ptr
,
nil
)
if
err
!=
nil
{
errs
=
packer
.
MultiErrorAppend
(
errs
,
fmt
.
Errorf
(
"Error processing %s: %s"
,
key
,
err
))
}
}
validates
:=
map
[
string
]
*
string
{
"output"
:
&
config
.
OutputPath
,
"vagrantfile_template"
:
&
config
.
VagrantfileTemplate
,
...
...
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