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
adfb6caa
Commit
adfb6caa
authored
Aug 09, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
provisioner/salt-masterless: error if any commands exit with non-zero
[GH-266] /cc @rgarcia
parent
91898ea8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
CHANGELOG.md
CHANGELOG.md
+2
-0
provisioner/salt-masterless/provisioner.go
provisioner/salt-masterless/provisioner.go
+3
-3
No files found.
CHANGELOG.md
View file @
adfb6caa
...
...
@@ -25,6 +25,8 @@ BUG FIXES:
using multiple environmental variables. [GH-263]
*
provisioner/salt-masterless: states aren't deleted after the run
anymore. [GH-265]
*
provisioner/salt-masterless: error if any commands exit with a non-zero
exit status. [GH-266]
## 0.2.3 (August 7, 2013)
...
...
provisioner/salt-masterless/provisioner.go
View file @
adfb6caa
...
...
@@ -99,7 +99,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
ui
.
Message
(
fmt
.
Sprintf
(
"Creating remote directory: %s"
,
p
.
config
.
TempConfigDir
))
cmd
:=
&
packer
.
RemoteCmd
{
Command
:
fmt
.
Sprintf
(
"mkdir -p %s"
,
p
.
config
.
TempConfigDir
)}
if
err
=
cmd
.
StartWithUi
(
comm
,
ui
);
err
!=
nil
{
if
err
=
cmd
.
StartWithUi
(
comm
,
ui
);
err
!=
nil
||
cmd
.
ExitStatus
!=
0
{
return
fmt
.
Errorf
(
"Error creating remote salt state directory: %s"
,
err
)
}
...
...
@@ -110,13 +110,13 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
ui
.
Message
(
fmt
.
Sprintf
(
"Moving %s to /srv/salt"
,
p
.
config
.
TempConfigDir
))
cmd
=
&
packer
.
RemoteCmd
{
Command
:
fmt
.
Sprintf
(
"sudo mv %s /srv/salt"
,
p
.
config
.
TempConfigDir
)}
if
err
=
cmd
.
StartWithUi
(
comm
,
ui
);
err
!=
nil
{
if
err
=
cmd
.
StartWithUi
(
comm
,
ui
);
err
!=
nil
||
cmd
.
ExitStatus
!=
0
{
return
fmt
.
Errorf
(
"Unable to move %s to /srv/salt: %d"
,
p
.
config
.
TempConfigDir
,
err
)
}
ui
.
Message
(
"Running highstate"
)
cmd
=
&
packer
.
RemoteCmd
{
Command
:
"sudo salt-call --local state.highstate -l info"
}
if
err
=
cmd
.
StartWithUi
(
comm
,
ui
);
err
!=
nil
{
if
err
=
cmd
.
StartWithUi
(
comm
,
ui
);
err
!=
nil
||
cmd
.
ExitStatus
!=
0
{
return
fmt
.
Errorf
(
"Error executing highstate: %s"
,
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