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
895d87d9
Commit
895d87d9
authored
Dec 11, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
provisioner/puppet-masterless: use Go 1.2 template comparators
parent
ae00414b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
CHANGELOG.md
CHANGELOG.md
+7
-0
provisioner/puppet-masterless/provisioner.go
provisioner/puppet-masterless/provisioner.go
+2
-6
No files found.
CHANGELOG.md
View file @
895d87d9
## 0.5.0 (unreleased)
BACKWARDS INCOMPATIBILITIES:
*
provisioner/puppet-masterless: The
`execute_command`
no longer has
the
`Has*`
variables, since the templating language now supports
comparison operations. See the Go documentation for more info:
http://golang.org/pkg/text/template/
IMPROVEMENTS:
*
core: Plugins communicate over a single TCP connection per plugin now,
...
...
provisioner/puppet-masterless/provisioner.go
View file @
895d87d9
...
...
@@ -49,11 +49,9 @@ type Provisioner struct {
type
ExecuteTemplate
struct
{
FacterVars
string
HasHieraConfigPath
bool
HieraConfigPath
string
ModulePath
string
ManifestFile
string
HasManifestDir
bool
ManifestDir
string
Sudo
bool
}
...
...
@@ -77,8 +75,8 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
if
p
.
config
.
ExecuteCommand
==
""
{
p
.
config
.
ExecuteCommand
=
"{{.FacterVars}} {{if .Sudo}} sudo -E {{end}}"
+
"puppet apply --verbose --modulepath='{{.ModulePath}}' "
+
"{{if .H
asHieraConfigPath
}}--hiera_config='{{.HieraConfigPath}}' {{end}}"
+
"{{if .
HasManifestDir
}}--manifestdir='{{.ManifestDir}}' {{end}}"
+
"{{if .H
ieraConfigPath ne ""
}}--hiera_config='{{.HieraConfigPath}}' {{end}}"
+
"{{if .
ManifestDir ne ""
}}--manifestdir='{{.ManifestDir}}' {{end}}"
+
"--detailed-exitcodes "
+
"{{.ManifestFile}}"
}
...
...
@@ -262,9 +260,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
// Execute Puppet
command
,
err
:=
p
.
config
.
tpl
.
Process
(
p
.
config
.
ExecuteCommand
,
&
ExecuteTemplate
{
FacterVars
:
strings
.
Join
(
facterVars
,
" "
),
HasHieraConfigPath
:
remoteHieraConfigPath
!=
""
,
HieraConfigPath
:
remoteHieraConfigPath
,
HasManifestDir
:
remoteManifestDir
!=
""
,
ManifestDir
:
remoteManifestDir
,
ManifestFile
:
remoteManifestFile
,
ModulePath
:
strings
.
Join
(
modulePaths
,
":"
),
...
...
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