Faidon Liambotis has submitted this change and it was merged.
Change subject: puppetmaster: add GeoLite to geoip, fix for Labs
......................................................................
puppetmaster: add GeoLite to geoip, fix for Labs
Add the new geoip::data::lite class to the puppetmaster, so that GeoLite
databases are fetched and made available to hosts as well.
While at it, remove the proprietary databases from the Labs
puppetmaster, so we can be sure they won't be made available by mistake
to public instances.
Change-Id: I441a44cf65e850714adc9de355f1839647729ffc
---
M modules/puppetmaster/manifests/geoip.pp
1 file changed, 40 insertions(+), 20 deletions(-)
Approvals:
Faidon Liambotis: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/puppetmaster/manifests/geoip.pp
b/modules/puppetmaster/manifests/geoip.pp
index 352aec8..665aab5 100644
--- a/modules/puppetmaster/manifests/geoip.pp
+++ b/modules/puppetmaster/manifests/geoip.pp
@@ -1,26 +1,46 @@
class puppetmaster::geoip {
- include passwords::geoip
- # Including geoip with data_provider => maxmind will install a
- # cron job to download GeoIP data files from Maxmind weekly.
- # Setting data_directory will have those files downloaded into
- # data_directory. By downloading these files into the
- # volatiledir they will be available for other nodes to get via
- # puppet by including geoip with data_provider => 'puppet'.
+ # Fetch the GeoIP databases into puppet's volatile dir, so that other hosts
+ # can then just sync that directory into their own /usr/share/GeoIP via a
+ # normal puppet File resource (see the geoip module for more)
- # Sigh, need to manually include ::geoip::data here, since we are
- # changing data_directory and puppet class inheritance with parameters
- # is funky.
- class { '::geoip::data':
- data_directory => "${puppetmaster::volatiledir}/GeoIP",
+ $geoip_destdir = "${puppetmaster::volatiledir}/GeoIP"
+ $environment = 'http_proxy=http://brewster.wikimedia.org:8080'
+
+ package { 'geoip-database':
+ ensure => absent,
}
- # NOTE: use brewster as http proxy, since puppetmaster probably does not
- # have internet access
+
+ # installs the geoip-bin package
class { '::geoip':
- data_provider => 'maxmind',
- data_directory => "${puppetmaster::volatiledir}/GeoIP",
- environment => 'http_proxy=http://brewster.wikimedia.org:8080',
- license_key => $passwords::geoip::license_key,
- user_id => $passwords::geoip::user_id,
- product_ids => [106, 133, 115],
+ data_provider => undef,
+ }
+
+ # fetch the GeoLite databases
+ class { 'geoip::data::lite':
+ data_directory => $geoip_destdir,
+ environment => $environment,
+ }
+
+ if $::is_labs_puppet_master {
+ # compatibility symlinks
+ file { "$geoip_destdir/GeoIP.dat":
+ ensure => link,
+ target => "$geoip_destdir/GeoLite.dat",
+ }
+ file { "$geoip_destdir/GeoIPCity.dat":
+ ensure => link,
+ target => "$geoip_destdir/GeoLiteCity.dat",
+ }
+ } else {
+ # Fetch the proprietary paid-for MaxMind database
+ include passwords::geoip
+
+ class { 'geoip::data::maxmind':
+ data_directory => $geoip_destdir,
+ environment => $environment,
+ license_key => $passwords::geoip::license_key,
+ user_id => $passwords::geoip::user_id,
+ product_ids => [106, 133, 115],
+ }
}
}
--
To view, visit https://gerrit.wikimedia.org/r/93684
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I441a44cf65e850714adc9de355f1839647729ffc
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits