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

fixed #1: fixed puppet-lint formatting warnings #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
100 changes: 50 additions & 50 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,30 @@
# - execrecursive: as an alternative to using the recurse method for file ownership this just does chmod and chown -- it is much faster than the recurse method (Default true)

define fetchfile(
$downloadurl=undef,
$downloadfile=undef,
$downloadto=undef,
$compression='tar.gz',
$desintationpath=undef,
$destinationfile=undef,
$owner='root',
$group='root',
$mode='775',
$recurse=false,
$execrecurse=true
$downloadurl=undef,
$downloadfile=undef,
$downloadto=undef,
$compression='tar.gz',
$desintationpath=undef,
$destinationfile=undef,
$owner='root',
$group='root',
$mode='775',
$recurse=false,
$execrecurse=true
) {

# common things for exec
$execlaunchpaths = ["/usr/bin", "/usr/sbin", "/bin", "/sbin", "/etc"]
$executefrom = "/tmp/"
$execlaunchpaths = ['/usr/bin', '/usr/sbin', '/bin', '/sbin', '/etc']
$executefrom = '/tmp/'

# creates tests for commandline execution
$wgetcreates = "${downloadto}${downloadfile}"

# destination creates
$destinationcreates = "${desintationpath}${destinationfile}"
# commands to be run by exec

# commands to be run by exec
$wgetcommand ="wget -O '${wgetcreates}' '${downloadurl}'"
$chowncommand = "chown -R ${owner}:${group} ${destinationcreates}"
$chmodcommand = "chmod -R ${mode} ${destinationcreates}"
Expand All @@ -59,48 +59,48 @@

# downloads file
exec {"${name}_fetchfiledownload":
command=>$wgetcommand,
cwd=> $executefrom,
path=> $execlaunchpaths,
creates=>$wgetcreates,
logoutput=> on_failure,
command => $wgetcommand,
cwd => $executefrom,
path => $execlaunchpaths,
creates => $wgetcreates,
logoutput => on_failure,
}

# make destination file
exec {"${name}_fetchfiledecompress":
command=>$destinationcommand,
cwd=> $executefrom,
path=> $execlaunchpaths,
creates=>$destinationcreates,
logoutput=> on_failure,
require=>exec["${name}_fetchfiledownload"]
command => $destinationcommand,
cwd => $executefrom,
path => $execlaunchpaths,
creates => $destinationcreates,
logoutput => on_failure,
require => Exec["${name}_fetchfiledownload"]
}

# Mod file
file {"${name}_fetchfiledecompress":
path=>$destinationcreates,
owner=>$owner,
group=>$group,
mode=>$mode,
recurse=>$recurse,
require=>exec["${name}_fetchfiledecompress"]
path => $destinationcreates,
owner => $owner,
group => $group,
mode => $mode,
recurse => $recurse,
require => Exec["${name}_fetchfiledecompress"]
}

if $execrecurse == true {
exec {"${name}_chmoddestinationfile":
command=>$chmodcommand,
cwd=> $executefrom,
path=> $execlaunchpaths,
logoutput=> on_failure,
require=>file["${name}_fetchfiledecompress"]
}
exec {"${name}_chowndestinationfile":
command=>$chowncommand,
cwd=> $executefrom,
path=> $execlaunchpaths,
logoutput=> on_failure,
require=>file["${name}_fetchfiledecompress"]
command => $chmodcommand,
cwd => $executefrom,
path => $execlaunchpaths,
logoutput => on_failure,
require => File["${name}_fetchfiledecompress"]
}

exec {"${name}_chowndestinationfile":
command => $chowncommand,
cwd => $executefrom,
path => $execlaunchpaths,
logoutput => on_failure,
require => File["${name}_fetchfiledecompress"]
}
}
}
100 changes: 50 additions & 50 deletions pkg/runthebusiness-fetchfile-1.0.0/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,30 @@
# - execrecursive: as an alternative to using the recurse method for file ownership this just does chmod and chown -- it is much faster than the recurse method (Default true)

define fetchfile(
$downloadurl=undef,
$downloadfile=undef,
$downloadto=undef,
$compression='tar.gz',
$desintationpath=undef,
$destinationfile=undef,
$owner='root',
$group='root',
$mode='775',
$recurse=false,
$execrecurse=true
$downloadurl=undef,
$downloadfile=undef,
$downloadto=undef,
$compression='tar.gz',
$desintationpath=undef,
$destinationfile=undef,
$owner='root',
$group='root',
$mode='775',
$recurse=false,
$execrecurse=true
) {

# common things for exec
$execlaunchpaths = ["/usr/bin", "/usr/sbin", "/bin", "/sbin", "/etc"]
$executefrom = "/tmp/"
$execlaunchpaths = ['/usr/bin', '/usr/sbin', '/bin', '/sbin', '/etc']
$executefrom = '/tmp/'

# creates tests for commandline execution
$wgetcreates = "${downloadto}${downloadfile}"

# destination creates
$destinationcreates = "${desintationpath}${destinationfile}"
# commands to be run by exec

# commands to be run by exec
$wgetcommand ="wget -O '${wgetcreates}' '${downloadurl}'"
$chowncommand = "chown -R ${owner}:${group} ${destinationcreates}"
$chmodcommand = "chmod -R ${mode} ${destinationcreates}"
Expand All @@ -59,48 +59,48 @@

# downloads file
exec {"${name}_fetchfiledownload":
command=>$wgetcommand,
cwd=> $executefrom,
path=> $execlaunchpaths,
creates=>$wgetcreates,
logoutput=> on_failure,
command => $wgetcommand,
cwd => $executefrom,
path => $execlaunchpaths,
creates => $wgetcreates,
logoutput => on_failure,
}

# make destination file
exec {"${name}_fetchfiledecompress":
command=>$destinationcommand,
cwd=> $executefrom,
path=> $execlaunchpaths,
creates=>$destinationcreates,
logoutput=> on_failure,
require=>exec["${name}_fetchfiledownload"]
command => $destinationcommand,
cwd => $executefrom,
path => $execlaunchpaths,
creates => $destinationcreates,
logoutput => on_failure,
require => exec["${name}_fetchfiledownload"]
}

# Mod file
file {"${name}_fetchfiledecompress":
path=>$destinationcreates,
owner=>$owner,
group=>$group,
mode=>$mode,
recurse=>$recurse,
require=>exec["${name}_fetchfiledecompress"]
path => $destinationcreates,
owner => $owner,
group => $group,
mode => $mode,
recurse => $recurse,
require => exec["${name}_fetchfiledecompress"]
}

if $execrecurse == true {
exec {"${name}_chmoddestinationfile":
command=>$chmodcommand,
cwd=> $executefrom,
path=> $execlaunchpaths,
logoutput=> on_failure,
require=>file["${name}_fetchfiledecompress"]
}
exec {"${name}_chowndestinationfile":
command=>$chowncommand,
cwd=> $executefrom,
path=> $execlaunchpaths,
logoutput=> on_failure,
require=>file["${name}_fetchfiledecompress"]
command => $chmodcommand,
cwd => $executefrom,
path => $execlaunchpaths,
logoutput => on_failure,
require => file["${name}_fetchfiledecompress"]
}

exec {"${name}_chowndestinationfile":
command => $chowncommand,
cwd => $executefrom,
path => $execlaunchpaths,
logoutput => on_failure,
require => file["${name}_fetchfiledecompress"]
}
}
}