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
106c9403
Commit
106c9403
authored
Jun 15, 2015
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
provisioner/chef-client: chmod the directories
parent
a1f18347
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
provisioner/chef-client/provisioner.go
provisioner/chef-client/provisioner.go
+13
-4
website/source/docs/provisioners/chef-client.html.markdown
website/source/docs/provisioners/chef-client.html.markdown
+9
-0
No files found.
provisioner/chef-client/provisioner.go
View file @
106c9403
...
@@ -310,16 +310,25 @@ func (p *Provisioner) createDir(ui packer.Ui, comm packer.Communicator, dir stri
...
@@ -310,16 +310,25 @@ func (p *Provisioner) createDir(ui packer.Ui, comm packer.Communicator, dir stri
mkdirCmd
=
"sudo "
+
mkdirCmd
mkdirCmd
=
"sudo "
+
mkdirCmd
}
}
cmd
:=
&
packer
.
RemoteCmd
{
cmd
:=
&
packer
.
RemoteCmd
{
Command
:
mkdirCmd
}
Command
:
mkdirCmd
,
if
err
:=
cmd
.
StartWithUi
(
comm
,
ui
);
err
!=
nil
{
return
err
}
if
cmd
.
ExitStatus
!=
0
{
return
fmt
.
Errorf
(
"Non-zero exit status. See output above for more info."
)
}
}
// Chmod the directory to 0777 just so that we can access it as our user
mkdirCmd
=
fmt
.
Sprintf
(
"chmod 0777 '%s'"
,
dir
)
if
!
p
.
config
.
PreventSudo
{
mkdirCmd
=
"sudo "
+
mkdirCmd
}
cmd
=
&
packer
.
RemoteCmd
{
Command
:
mkdirCmd
}
if
err
:=
cmd
.
StartWithUi
(
comm
,
ui
);
err
!=
nil
{
if
err
:=
cmd
.
StartWithUi
(
comm
,
ui
);
err
!=
nil
{
return
err
return
err
}
}
if
cmd
.
ExitStatus
!=
0
{
if
cmd
.
ExitStatus
!=
0
{
return
fmt
.
Errorf
(
"Non-zero exit status."
)
return
fmt
.
Errorf
(
"Non-zero exit status.
See output above for more info.
"
)
}
}
return
nil
return
nil
...
...
website/source/docs/provisioners/chef-client.html.markdown
View file @
106c9403
...
@@ -161,3 +161,12 @@ curl -L https://www.opscode.com/chef/install.sh | \
...
@@ -161,3 +161,12 @@ curl -L https://www.opscode.com/chef/install.sh | \
```
```
This command can be customized using the
`install_command`
configuration.
This command can be customized using the
`install_command`
configuration.
## Folder Permissions
The
`chef-client`
provisioner will chmod the directory with your Chef
keys to 777. This is to ensure that Packer can upload and make use of that
directory. However, once the machine is created, you usually don't
want to keep these directories with those permissions. To change the
permissions on the directories, append a shell provisioner after Chef
to modify them.
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