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
6b1a7938
Commit
6b1a7938
authored
Sep 26, 2013
by
Matthew Hooker
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into 430
parents
ee60ed31
8cdb92e3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
10 deletions
+69
-10
CHANGELOG.md
CHANGELOG.md
+3
-0
builder/amazon/chroot/step_attach_volume.go
builder/amazon/chroot/step_attach_volume.go
+7
-6
builder/amazon/chroot/step_create_volume.go
builder/amazon/chroot/step_create_volume.go
+2
-1
builder/amazon/chroot/step_snapshot.go
builder/amazon/chroot/step_snapshot.go
+2
-1
communicator/ssh/communicator.go
communicator/ssh/communicator.go
+21
-2
website/source/docs/builders/amazon-chroot.html.markdown
website/source/docs/builders/amazon-chroot.html.markdown
+34
-0
No files found.
CHANGELOG.md
View file @
6b1a7938
...
...
@@ -3,6 +3,9 @@
BUG FIXES:
*
core: default user variable values don't need to be strings. [GH-456]
*
builder/amazon-chroot: Fix errors with waitin for state change. [GH-459]
*
communicator/ssh: SCP uploads now work properly when directories
contain symlinks. [GH-449]
## 0.3.8 (September 22, 2013)
...
...
builder/amazon/chroot/step_attach_volume.go
View file @
6b1a7938
...
...
@@ -60,7 +60,8 @@ func (s *StepAttachVolume) Run(state multistep.StateBag) multistep.StepAction {
return
nil
,
""
,
errors
.
New
(
"No attachments on volume."
)
}
return
nil
,
resp
.
Volumes
[
0
]
.
Attachments
[
0
]
.
Status
,
nil
a
:=
resp
.
Volumes
[
0
]
.
Attachments
[
0
]
return
a
,
a
.
Status
,
nil
},
}
...
...
@@ -111,12 +112,12 @@ func (s *StepAttachVolume) CleanupFunc(state multistep.StateBag) error {
return
nil
,
""
,
err
}
state
:=
"detached"
if
len
(
resp
.
Volumes
[
0
]
.
Attachments
)
>
0
{
state
=
resp
.
Volumes
[
0
]
.
Attachments
[
0
]
.
Status
v
:=
resp
.
Volumes
[
0
]
if
len
(
v
.
Attachments
)
>
0
{
return
v
,
v
.
Attachments
[
0
]
.
Status
,
nil
}
else
{
return
v
,
"detached"
,
nil
}
return
nil
,
state
,
nil
},
}
...
...
builder/amazon/chroot/step_create_volume.go
View file @
6b1a7938
...
...
@@ -75,7 +75,8 @@ func (s *StepCreateVolume) Run(state multistep.StateBag) multistep.StepAction {
return
nil
,
""
,
err
}
return
nil
,
resp
.
Volumes
[
0
]
.
Status
,
nil
v
:=
resp
.
Volumes
[
0
]
return
v
,
v
.
Status
,
nil
},
}
...
...
builder/amazon/chroot/step_snapshot.go
View file @
6b1a7938
...
...
@@ -51,7 +51,8 @@ func (s *StepSnapshot) Run(state multistep.StateBag) multistep.StepAction {
return
nil
,
""
,
errors
.
New
(
"No snapshots found."
)
}
return
nil
,
resp
.
Snapshots
[
0
]
.
Status
,
nil
s
:=
resp
.
Snapshots
[
0
]
return
s
,
s
.
Status
,
nil
},
}
...
...
communicator/ssh/communicator.go
View file @
6b1a7938
...
...
@@ -408,8 +408,27 @@ func scpUploadDir(root string, fs []os.FileInfo, w io.Writer, r *bufio.Reader) e
for
_
,
fi
:=
range
fs
{
realPath
:=
filepath
.
Join
(
root
,
fi
.
Name
())
if
!
fi
.
IsDir
()
{
// It is a regular file, just upload it
// Track if this is actually a symlink to a directory. If it is
// a symlink to a file we don't do any special behavior because uploading
// a file just works. If it is a directory, we need to know so we
// treat it as such.
isSymlinkToDir
:=
false
if
fi
.
Mode
()
&
os
.
ModeSymlink
==
os
.
ModeSymlink
{
symPath
,
err
:=
filepath
.
EvalSymlinks
(
realPath
)
if
err
!=
nil
{
return
err
}
symFi
,
err
:=
os
.
Lstat
(
symPath
)
if
err
!=
nil
{
return
err
}
isSymlinkToDir
=
symFi
.
IsDir
()
}
if
!
fi
.
IsDir
()
&&
!
isSymlinkToDir
{
// It is a regular file (or symlink to a file), just upload it
f
,
err
:=
os
.
Open
(
realPath
)
if
err
!=
nil
{
return
err
...
...
website/source/docs/builders/amazon-chroot.html.markdown
View file @
6b1a7938
...
...
@@ -188,3 +188,37 @@ out of your AMI builds.
Packer properly obtains a process lock for the parallelism-sensitive parts
of its internals such as finding an available device.
## Using an IAM Instance Profile
If AWS keys are not specified in the template or through environment variables
Packer will use credentials provided by the instance's IAM profile, if it has one.
The following policy document provides the minimal set permissions necessary for Packer to work:
<pre
class=
"prettyprint"
>
{
"Statement": [{
"Effect": "Allow",
"Action" : [
"ec2:AttachVolume",
"ec2:CreateVolume",
"ec2:DeleteVolume",
"ec2:DescribeVolumes",
"ec2:DetachVolume",
"ec2:DescribeInstances",
"ec2:CreateSnapshot",
"ec2:DeleteSnapshot",
"ec2:DescribeSnapshots",
"ec2:DescribeImages",
"ec2:RegisterImage",
"ec2:CreateTags"
],
"Resource" : "*"
}]
}
</pre>
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