Matanya has uploaded a new change for review.
https://gerrit.wikimedia.org/r/99067
Change subject: rsync: 2 spaces to 4 spaces.
......................................................................
rsync: 2 spaces to 4 spaces.
Change-Id: Ic2b91c69f2ba1591ac5d4ba67f416c6aba911386
---
M modules/rsync/manifests/get.pp
M modules/rsync/manifests/init.pp
M modules/rsync/manifests/repo.pp
M modules/rsync/manifests/server.pp
M modules/rsync/manifests/server/module.pp
5 files changed, 101 insertions(+), 97 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/67/99067/1
diff --git a/modules/rsync/manifests/get.pp b/modules/rsync/manifests/get.pp
index 1f3ff28..5b21dcb 100644
--- a/modules/rsync/manifests/get.pp
+++ b/modules/rsync/manifests/get.pp
@@ -25,51 +25,55 @@
# } # rsync
#
define rsync::get (
- $source,
- $path = undef,
- $user = undef,
- $purge = undef,
- $exclude = undef,
- $keyfile = undef,
- $timeout = '900'
+ $source,
+ $path = undef,
+ $user = undef,
+ $purge = undef,
+ $exclude = undef,
+ $keyfile = undef,
+ $timeout = '900'
) {
- if $keyfile {
- $Mykeyfile = $keyfile
- } else {
- $Mykeyfile = "/home/${user}/.ssh/id_rsa"
- }
+ if $keyfile {
+ $Mykeyfile = $keyfile
+ }
- if $user {
- $MyUser = "-e 'ssh -i ${Mykeyfile} -l ${user}' ${user}@"
- }
+ else {
+ $Mykeyfile = "/home/${user}/.ssh/id_rsa"
+ }
- if $purge {
- $MyPurge = '--delete'
- }
+ if $user {
+ $MyUser = "-e 'ssh -i ${Mykeyfile} -l ${user}' ${user}@"
+ }
- if $exclude {
- $MyExclude = "--exclude=${exclude}"
- }
+ if $purge {
+ $MyPurge = '--delete'
+ }
- if $path {
- $MyPath = $path
- } else {
- $MyPath = $name
- }
+ if $exclude {
+ $MyExclude = "--exclude=${exclude}"
+ }
- $rsync_options = "-a ${MyPurge} ${MyExclude} ${MyUser}${source} ${MyPath}"
+ if $path {
+ $MyPath = $path
+ }
- exec { "rsync ${name}":
- command => "rsync -q ${rsync_options}",
- path => [ '/bin', '/usr/bin' ],
+ else {
+ $MyPath = $name
+ }
+
+ $rsync_options = "-a ${MyPurge} ${MyExclude} ${MyUser}${source} ${MyPath}"
+
+ exec { "rsync ${name}":
+ command => "rsync -q ${rsync_options}",
+ path => [ '/bin', '/usr/bin' ],
# perform a dry-run to determine if anything needs to be updated
# this ensures that we only actually create a Puppet event if something
needs to
# be updated
# TODO - it may make senes to do an actual run here (instead of a dry run)
# and relace the command with an echo statement or something to
ensure
# that we only actually run rsync once
- onlyif => "test `rsync --dry-run --itemize-changes ${rsync_options} | wc
-l` -gt 0",
- timeout => $timeout,
- }
+ onlyif => "test `rsync --dry-run --itemize-changes ${rsync_options} |
wc -l` -gt 0",
+ timeout => $timeout,
+ }
}
diff --git a/modules/rsync/manifests/init.pp b/modules/rsync/manifests/init.pp
index 2f205c2..3d81349 100644
--- a/modules/rsync/manifests/init.pp
+++ b/modules/rsync/manifests/init.pp
@@ -4,7 +4,7 @@
#
class rsync {
- package { 'rsync':
- ensure => installed,
- } -> Rsync::Get<| |>
+ package { 'rsync':
+ ensure => installed,
+ } -> Rsync::Get<| |>
}
diff --git a/modules/rsync/manifests/repo.pp b/modules/rsync/manifests/repo.pp
index 2b88f9e..2f472c7 100644
--- a/modules/rsync/manifests/repo.pp
+++ b/modules/rsync/manifests/repo.pp
@@ -7,17 +7,17 @@
#
class rsync::repo {
- include rsync::server
+ include rsync::server
- $base = '/data/rsync'
+ $base = '/data/rsync'
- file { $base:
- ensure => directory,
- }
+ file { $base:
+ ensure => directory,
+ }
- # setup default rsync repository
- rsync::server::module { 'repo':
- path => $base,
- require => File[$base],
- }
+ # setup default rsync repository
+ rsync::server::module { 'repo':
+ path => $base,
+ require => File[$base],
+ }
}
diff --git a/modules/rsync/manifests/server.pp
b/modules/rsync/manifests/server.pp
index 75aea85..1fff7ea 100644
--- a/modules/rsync/manifests/server.pp
+++ b/modules/rsync/manifests/server.pp
@@ -11,25 +11,25 @@
# into the WMF puppet repository. - otto
class rsync::server(
- $use_xinetd = false, # this parameter should not be used. xinetd is not
available.
- $address = '0.0.0.0',
- $motd_file = 'UNSET',
- $log_file = 'UNSET',
- $use_chroot = 'yes'
+ $use_xinetd = false, # this parameter should not be used. xinetd is not
available.
+ $address = '0.0.0.0',
+ $motd_file = 'UNSET',
+ $log_file = 'UNSET',
+ $use_chroot = 'yes'
) inherits rsync {
- $rsync_fragments = '/etc/rsync.d'
- $rsync_conf = '/etc/rsyncd.conf'
- $rsync_pid = '/var/run/rsync.pid'
+ $rsync_fragments = '/etc/rsync.d'
+ $rsync_conf = '/etc/rsyncd.conf'
+ $rsync_pid = '/var/run/rsync.pid'
- # rsync daemon defaults file
- file { "/etc/default/rsync":
- ensure => present,
- mode => 0444,
- owner => root,
- group => root,
- content => template("rsync/rsync.default.erb"),
- }
+ # rsync daemon defaults file
+ file { '/etc/default/rsync':
+ ensure => present,
+ mode => '0444',
+ owner => 'root',
+ group => 'root',
+ content => template('rsync/rsync.default.erb'),
+ }
# if($use_xinetd) {
# include xinetd
@@ -48,28 +48,28 @@
}
# }
- if $motd_file != 'UNSET' {
- file { '/etc/rsync-motd':
- source => 'puppet:///modules/rsync/motd',
+ if $motd_file != 'UNSET' {
+ file { '/etc/rsync-motd':
+ source => 'puppet:///modules/rsync/motd',
+ }
}
- }
- file { $rsync_fragments:
- ensure => directory,
- }
+ file { $rsync_fragments:
+ ensure => directory,
+ }
- file { "${rsync_fragments}/header":
- content => template('rsync/header.erb'),
- }
+ file { "${rsync_fragments}/header":
+ content => template('rsync/header.erb'),
+ }
# perhaps this should be a script
# this allows you to only have a header and no fragments, which happens
# by default if you have an rsync::server but not an rsync::repo on a host
# which happens with cobbler systems by default
- exec { 'compile fragments':
- refreshonly => true,
- command => "ls ${rsync_fragments}/frag-* 1>/dev/null 2>/dev/null && if
[ $? -eq 0 ]; then cat ${rsync_fragments}/header ${rsync_fragments}/frag-* >
${rsync_conf}; else cat ${rsync_fragments}/header > ${rsync_conf}; fi; $(exit
0)",
- subscribe => File["${rsync_fragments}/header"],
- path => '/bin:/usr/bin',
- }
+ exec { 'compile fragments':
+ refreshonly => true,
+ command => "ls ${rsync_fragments}/frag-* 1>/dev/null 2>/dev/null
&& if [ $? -eq 0 ]; then cat ${rsync_fragments}/header
${rsync_fragments}/frag-* > ${rsync_conf}; else cat ${rsync_fragments}/header >
${rsync_conf}; fi; $(exit 0)",
+ subscribe => File["${rsync_fragments}/header"],
+ path => '/bin:/usr/bin',
+ }
}
diff --git a/modules/rsync/manifests/server/module.pp
b/modules/rsync/manifests/server/module.pp
index 241a551..43e19a1 100644
--- a/modules/rsync/manifests/server/module.pp
+++ b/modules/rsync/manifests/server/module.pp
@@ -33,24 +33,24 @@
# }
#
define rsync::server::module (
- $path,
- $comment = undef,
- $read_only = 'yes',
- $write_only = 'no',
- $list = 'yes',
- $uid = '0',
- $gid = '0',
- $incoming_chmod = '0644',
- $outgoing_chmod = '0644',
- $max_connections = '0',
- $lock_file = '/var/run/rsyncd.lock',
- $secrets_file = undef,
- $auth_users = undef,
- $hosts_allow = undef,
- $hosts_deny = undef) {
+ $path,
+ $comment = undef,
+ $read_only = 'yes',
+ $write_only = 'no',
+ $list = 'yes',
+ $uid = '0',
+ $gid = '0',
+ $incoming_chmod = '0644',
+ $outgoing_chmod = '0644',
+ $max_connections = '0',
+ $lock_file = '/var/run/rsyncd.lock',
+ $secrets_file = undef,
+ $auth_users = undef,
+ $hosts_allow = undef,
+ $hosts_deny = undef) {
- file { "${rsync::server::rsync_fragments}/frag-${name}":
- content => template('rsync/module.erb'),
- notify => Exec['compile fragments'],
- }
+ file { "${rsync::server::rsync_fragments}/frag-${name}":
+ content => template('rsync/module.erb'),
+ notify => Exec['compile fragments'],
+ }
}
--
To view, visit https://gerrit.wikimedia.org/r/99067
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic2b91c69f2ba1591ac5d4ba67f416c6aba911386
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Matanya <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits