X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fstaticsync%2Fmanifests%2Fbase.pp;h=3f6cd927cb2e2807c2d963bcdff306d9572a0e58;hb=refs%2Fheads%2Ffordsaold;hp=89a0a383c3fa9914ddb5eefc704c16ef783d8ab1;hpb=0c067639ec7d7050b69249b85e6aa83ab91820b5;p=mirror%2Fdsa-puppet.git diff --git a/modules/staticsync/manifests/base.pp b/modules/staticsync/manifests/base.pp index 89a0a383c..3f6cd927c 100644 --- a/modules/staticsync/manifests/base.pp +++ b/modules/staticsync/manifests/base.pp @@ -1,31 +1,37 @@ # the base class defining things common for all three static classes (master, mirror, source) -class roles::static::base { - $query = 'nodes[certname] { resources { type = "Class" and title = "Roles::Static_mirror" } }' +class staticsync::base inherits staticsync { + + # fetch the list of static mirrors from PuppetDB + # + # This list is necessary so we can both do "include only these + # mirrors" but also "exclude these mirrors and include all others" + # in the config. + $query = 'nodes[certname] { resources { type = "Class" and title = "Staticsync::Static_mirror" } }' $static_mirrors = sort(puppetdb_query($query).map |$value| { $value["certname"] }) file { '/etc/static-components.conf': - content => template('roles/static-mirroring/static-components.conf.erb'), + content => template('staticsync/static-components.conf.erb'), } file { '/usr/local/bin/staticsync-ssh-wrap': - source => 'puppet:///modules/roles/static-mirroring/staticsync-ssh-wrap', + source => 'puppet:///modules/staticsync/staticsync-ssh-wrap', mode => '0555', } file { '/usr/local/bin/static-update-component': - source => 'puppet:///modules/roles/static-mirroring/static-update-component', - mode => '0555', + source => 'puppet:///modules/staticsync/static-update-component', + mode => '0555', } file { '/etc/staticsync.conf': content => @("EOF"), - # This file is sourced by bash - # and parsed by python - # - empty lines and lines starting with a # are ignored. - # - other lines are key=value. No extra spaces anywhere. No quoting. - base=/srv/static.debian.org - masterbase=/home/staticsync/static-master/master - staticuser=staticsync - | EOF + # This file is sourced by bash + # and parsed by python + # - empty lines and lines starting with a # are ignored. + # - other lines are key=value. No extra spaces anywhere. No quoting. + base=${staticsync::basedir} + masterbase=${staticsync::basedir}/master + staticuser=${staticsync::user} + | EOF } }