serialname = '.serial'
clients = []
-with open('/home/staticsync/etc/static-clients') as f:
+with open('/etc/static-clients.conf') as f:
for line in f:
- clients.append(line.strip())
+ line = line.strip()
+ if line == "": continue
+ if line.startswith('#'): continue
+ clients.append(line)
def log(m):
t = time.strftime("[%Y-%m-%d %H:%M:%S]", time.gmtime())
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-componentlist=/home/staticsync/etc/static-components
+componentlist=/etc/static-components.conf
base=/home/staticsync/static-master/master
set -e
'/etc/static-components.conf':
source => "puppet:///modules/roles/static-mirroring/static-components.conf",
;
+ '/etc/static-clients.conf':
+ content => template('roles/static-clients.conf.erb'),
+ ;
}
}
# vim:set et:
--- /dev/null
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+##
+
+<%=
+
+mirrors = []
+scope.lookupvar('site::localinfo').keys.sort.each do |node|
+ if scope.lookupvar('site::localinfo')[node]['static_mirror']
+ mirrors << node
+ end
+end
+
+
+mirrors.join("\n")
+# vim:set et:
+# vim:set sts=4 ts=4:
+# vim:set shiftwidth=4:
+%>