make syncproxy rsync.conf a template
authorPeter Palfrader <peter@palfrader.org>
Mon, 21 Dec 2015 19:21:18 +0000 (20:21 +0100)
committerPeter Palfrader <peter@palfrader.org>
Mon, 21 Dec 2015 19:21:18 +0000 (20:21 +0100)
modules/roles/files/syncproxy/rsyncd.conf [deleted file]
modules/roles/manifests/syncproxy.pp
modules/roles/templates/syncproxy/rsyncd.conf.erb [new file with mode: 0644]

diff --git a/modules/roles/files/syncproxy/rsyncd.conf b/modules/roles/files/syncproxy/rsyncd.conf
deleted file mode 100644 (file)
index 387a4e1..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-uid = nobody
-gid = nogroup
-max connections = 30
-syslog facility = daemon
-socket options = SO_KEEPALIVE
-timeout = 7200
-
-# weasel 2007-11-19
-log file =  /var/log/rsyncd/rsyncd.log
-
-[debian]
-  path = /srv/mirrors/debian/
-  comment = Full Debian FTP Archive (~1.5 TB as of 2015; contact mirrors@debian.org for access)
-  auth users = *
-  read only = true
-  secrets file = /etc/rsyncd/debian.secrets
-
-[debian-backports]
-  path = /srv/mirrors/debian-backports/
-  comment = Debian backports archive (up to, including Debian 6.0(squeeze) - ~35 GB; contact mirrors@debian.org for access)
-  auth users = *
-  read only = true
-  secrets file = /etc/rsyncd/debian.secrets
-
-[debian-debug]
-  path = /srv/mirrors/debian-debug/
-  comment = Debug packages.  Probably large.  Starting end of 2015.
-  auth users = *
-  read only = true
-  secrets file = /etc/rsyncd/debian.secrets
-  list = no
-
-[debian-security]
-  path = /srv/mirrors/debian-security/
-  comment = Debian security archive (~100 GB; contact mirrors@debian.org for access)
-  auth users = *
-  read only = true
-  secrets file = /etc/rsyncd/debian.secrets
-
index 087c13a..c618bcc 100644 (file)
@@ -1,6 +1,6 @@
 class roles::syncproxy {
        rsync::site { 'syncproxy':
-               source => 'puppet:///modules/roles/syncproxy/rsyncd.conf',
+               content => template('roles/syncproxy/rsyncd.conf.erb',
                bind   => $::hostname ? {
                        'milanollo' => '5.153.231.9',
                        'mirror-isc' => '149.20.20.21',
diff --git a/modules/roles/templates/syncproxy/rsyncd.conf.erb b/modules/roles/templates/syncproxy/rsyncd.conf.erb
new file mode 100644 (file)
index 0000000..832ad9e
--- /dev/null
@@ -0,0 +1,50 @@
+uid = nobody
+gid = nogroup
+max connections = 30
+syslog facility = daemon
+socket options = SO_KEEPALIVE
+timeout = 7200
+
+# weasel 2007-11-19
+log file =  /var/log/rsyncd/rsyncd.log
+
+[debian]
+  path = /srv/mirrors/debian/
+<%- unless has_variable?("has_srv_mirrors_debian") && has_srv_mirrors_debian == "true" -%>
+  list = no
+<%- end -%>
+  comment = Full Debian FTP Archive (~1.5 TB as of 2015; contact mirrors@debian.org for access)
+  auth users = *
+  read only = true
+  secrets file = /etc/rsyncd/debian.secrets
+
+[debian-backports]
+  path = /srv/mirrors/debian-backports/
+<%- unless has_variable?("has_srv_mirrors_debian_backports") && has_srv_mirrors_debian_backports == "true" -%>
+  list = no
+<%- end -%>
+  comment = Debian backports archive (up to, including Debian 6.0(squeeze) - ~35 GB; contact mirrors@debian.org for access)
+  auth users = *
+  read only = true
+  secrets file = /etc/rsyncd/debian.secrets
+
+[debian-debug]
+<%- unless has_variable?("has_srv_mirrors_debian_debug") && has_srv_mirrors_debian_debug == "true" -%>
+  list = no
+<%- end -%>
+  path = /srv/mirrors/debian-debug/
+  comment = Debug packages.  Probably large.  Starting end of 2015.
+  auth users = *
+  read only = true
+  secrets file = /etc/rsyncd/debian.secrets
+
+[debian-security]
+<%- unless has_variable?("has_srv_mirrors_debian_security") && has_srv_mirrors_debian_security == "true" -%>
+  list = no
+<%- end -%>
+  path = /srv/mirrors/debian-security/
+  comment = Debian security archive (~100 GB; contact mirrors@debian.org for access)
+  auth users = *
+  read only = true
+  secrets file = /etc/rsyncd/debian.secrets
+