Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added owner, group and mode to init.pp #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
# }
#
define s3file (
$owner,
$group,
$mode,
$source,
$ensure = 'latest',
$s3_domain = 's3.amazonaws.com',
Expand All @@ -30,11 +33,17 @@
if $ensure == 'absent' {
# We use a puppet resource here to force the file to absent state
file { $name:
ensure => absent
ensure => absent,
}
} else {
$real_source = "https://${s3_domain}/${source}"

file { $name:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is wrong here

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, could you add whatever ordering is necessary to ensure this is done correctly? I expect we want to lay down an empty file with the right perms, then let curl dump the data into that. If that's the case, let's add that ordering in here. I don't want to assume we're running on a new enough puppet for manifest ordering to work.

owner => $owner,
group => $group,
mode => $mode,
}

if $ensure == 'latest' {
$unless = "[ -e ${name} ] && curl -I ${real_source} | grep ETag | grep `md5sum ${name} | cut -c1-32`"
} else {
Expand Down