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
40af1e68
Commit
40af1e68
authored
Aug 27, 2013
by
Rachid Belaid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix minion config with non tmp dir
parent
d6824a72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
provisioner/salt-masterless/provisioner.go
provisioner/salt-masterless/provisioner.go
+17
-12
No files found.
provisioner/salt-masterless/provisioner.go
View file @
40af1e68
...
...
@@ -107,18 +107,6 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
}
}
if
p
.
config
.
MinionConfig
!=
""
{
ui
.
Message
(
fmt
.
Sprintf
(
"Uploading minion config: %s"
,
p
.
config
.
MinionConfig
))
err
:=
uploadMinionConfig
(
comm
,
"/etc/salt/minion"
,
p
.
config
.
MinionConfig
)
if
err
!=
nil
{
return
err
}
}
if
err
=
UploadLocalDirectory
(
p
.
config
.
LocalStateTree
,
p
.
config
.
TempConfigDir
,
comm
,
ui
);
err
!=
nil
{
return
fmt
.
Errorf
(
"Error uploading local state tree to remote: %s"
,
err
)
}
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
||
cmd
.
ExitStatus
!=
0
{
...
...
@@ -129,6 +117,23 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
return
fmt
.
Errorf
(
"Error creating remote salt state directory: %s"
,
err
)
}
if
p
.
config
.
MinionConfig
!=
""
{
ui
.
Message
(
fmt
.
Sprintf
(
"Uploading minion config: %s"
,
p
.
config
.
MinionConfig
))
if
err
=
uploadMinionConfig
(
comm
,
fmt
.
Sprintf
(
"%s/minion"
,
p
.
config
.
TempConfigDir
),
p
.
config
.
MinionConfig
);
err
!=
nil
{
return
fmt
.
Errorf
(
"Error uploading local minion config file to remote: %s"
,
err
)
}
ui
.
Message
(
fmt
.
Sprintf
(
"Moving %s/minion to /etc/salt/minion"
,
p
.
config
.
TempConfigDir
))
cmd
=
&
packer
.
RemoteCmd
{
Command
:
fmt
.
Sprintf
(
"sudo mv %s/minion /etc/salt/minion"
,
p
.
config
.
TempConfigDir
)}
if
err
=
cmd
.
StartWithUi
(
comm
,
ui
);
err
!=
nil
||
cmd
.
ExitStatus
!=
0
{
if
err
==
nil
{
err
=
fmt
.
Errorf
(
"Bad exit status: %d"
,
cmd
.
ExitStatus
)
}
return
fmt
.
Errorf
(
"Unable to move %s/minion to /etc/salt/minion: %d"
,
p
.
config
.
TempConfigDir
,
err
)
}
}
ui
.
Message
(
fmt
.
Sprintf
(
"Uploading local state tree: %s"
,
p
.
config
.
LocalStateTree
))
if
err
=
UploadLocalDirectory
(
p
.
config
.
LocalStateTree
,
p
.
config
.
TempConfigDir
,
comm
,
ui
);
err
!=
nil
{
return
fmt
.
Errorf
(
"Error uploading local state tree to remote: %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