2 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
3 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
10 lines << "# This file has been autogenerated and pushed by puppet. Edit static-components.yaml in puppet."
11 lines << "# <master> <service> <source host> <directory> <extra push hosts, comma separated> <hosts to not mirror this component to>"
14 config = YAML.load(File.open('/etc/puppet/modules/roles/misc/static-components.yaml').read)
15 mirrors = scope.lookupvar('site::roles')['static_mirror']
17 config['components'].each_pair do |component, conf|
18 %w{exclude-mirrors extra-push}.each do |key|
19 conf[key] = [] unless conf.has_key?(key)
22 srchost, srcpath = conf['source'].split(':', 2)
24 config['mirrors'].each do |mirror, mc|
25 next unless mirrors.include?(mirror)
27 if mc.has_key?('components-include') and not mc['components-include'].include?(component)
28 conf['exclude-mirrors'] << mirror
32 exclude = conf['exclude-mirrors'].join(',')
33 exclude = '-' unless exclude != ""
34 extrapush = conf['extra-push'].join(',')
35 extrapush = '-' unless extrapush != ""
37 lines << "#{conf['master']} #{component} #{srchost} #{srcpath} #{extrapush} #{exclude}"