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
29864528
Commit
29864528
authored
Dec 11, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
provisioner/puppet-masterless: simplify manifest dir upload
parent
6aef1143
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
22 deletions
+10
-22
provisioner/puppet-masterless/provisioner.go
provisioner/puppet-masterless/provisioner.go
+6
-19
website/source/docs/provisioners/puppet-masterless.html.markdown
.../source/docs/provisioners/puppet-masterless.html.markdown
+4
-3
No files found.
provisioner/puppet-masterless/provisioner.go
View file @
29864528
...
...
@@ -31,7 +31,8 @@ type Config struct {
// The main manifest file to apply to kick off the entire thing.
ManifestFile
string
`mapstructure:"manifest_file"`
// The manifest dir, e.g. for includes
// A directory of manifest files that will be uploaded to the remote
// machine.
ManifestDir
string
`mapstructure:"manifest_dir"`
// If true, `sudo` will NOT be used to execute Puppet.
...
...
@@ -214,8 +215,10 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
// Upload manifest dir if set
remoteManifestDir
:=
""
if
p
.
config
.
ManifestDir
!=
""
{
var
err
error
remoteManifestDir
,
err
=
p
.
uploadManifestDir
(
ui
,
comm
)
ui
.
Message
(
fmt
.
Sprintf
(
"Uploading manifest directory from: %s"
,
p
.
config
.
ManifestDir
))
remoteManifestDir
=
fmt
.
Sprintf
(
"%s/manifests"
,
p
.
config
.
StagingDir
)
err
:=
p
.
uploadDirectory
(
ui
,
comm
,
remoteManifestDir
,
p
.
config
.
ManifestDir
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"Error uploading manifest dir: %s"
,
err
)
}
...
...
@@ -298,22 +301,6 @@ func (p *Provisioner) uploadHieraConfig(ui packer.Ui, comm packer.Communicator)
return
path
,
nil
}
func
(
p
*
Provisioner
)
uploadManifestDir
(
ui
packer
.
Ui
,
comm
packer
.
Communicator
)
(
string
,
error
)
{
ui
.
Message
(
"Uploading manifest dir..."
)
path
,
err
:=
os
.
Open
(
p
.
config
.
ManifestDir
)
if
err
!=
nil
{
return
""
,
err
}
defer
path
.
Close
()
targetPath
:=
fmt
.
Sprintf
(
"%s/manifests"
,
p
.
config
.
StagingDir
)
if
err
:=
p
.
uploadDirectory
(
ui
,
comm
,
targetPath
,
p
.
config
.
ManifestDir
);
err
!=
nil
{
return
""
,
fmt
.
Errorf
(
"Error uploading manifest dir: %s"
,
err
)
}
return
targetPath
,
nil
}
func
(
p
*
Provisioner
)
uploadManifests
(
ui
packer
.
Ui
,
comm
packer
.
Communicator
)
(
string
,
error
)
{
// Create the remote manifests directory...
ui
.
Message
(
"Uploading manifests..."
)
...
...
website/source/docs/provisioners/puppet-masterless.html.markdown
View file @
29864528
...
...
@@ -58,13 +58,14 @@ Optional parameters:
configuration to be uploaded to the remote machine. Hiera data directories
must be uploaded using the file provisioner separately.
*
`manifest_dir`
(string) - The path to a local directory with manifests
to be uploaded to the remote machine. This is useful if your main
manifest file uses imports.
*
`module_paths`
(array of strings) - This is an array of paths to module
directories on your local filesystem. These will be uploaded to the remote
machine. By default, this is empty.
*
`manifest_dir`
(string) - The path to a local directory with
manifests to be uploaded to the remote machine.
*
`prevent_sudo`
(boolean) - By default, the configured commands that are
executed to run Puppet are executed with
`sudo`
. If this is true,
then the sudo will be omitted.
...
...
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