Ottomata has submitted this change and it was merged.
Change subject: Make a self-hosted puppetmaster workalike for puppet::geoip
......................................................................
Make a self-hosted puppetmaster workalike for puppet::geoip
The new puppet::self::geoip class can be applied to a self-hosted
puppetmaster to provide work-alike resources for classes that need GeoIP
data.
Once this class is merged, the class should be added as an option in the
puppet-development puppet group on wikitech so instances can use it.
Change-Id: I7d561d55cab5d0cad60d88d44fba56ba3562e9b7
---
A modules/puppet/manifests/self/geoip.pp
M modules/puppet/manifests/self/gitclone.pp
2 files changed, 42 insertions(+), 0 deletions(-)
Approvals:
BryanDavis: Looks good to me, but someone else must approve
Ottomata: Verified; Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/puppet/manifests/self/geoip.pp
b/modules/puppet/manifests/self/geoip.pp
new file mode 100644
index 0000000..dd799a0
--- /dev/null
+++ b/modules/puppet/manifests/self/geoip.pp
@@ -0,0 +1,29 @@
+class puppet::self::geoip {
+ # 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)
+
+ $geoip_destdir = '/var/lib/puppet/volatile/GeoIP'
+
+ # geoip::data classes depend on this
+ file { $geoip_destdir:
+ ensure => directory,
+ }
+
+ # fetch the GeoLite databases
+ class { 'geoip::data::lite':
+ data_directory => $geoip_destdir,
+ }
+
+ # compatibility symlinks, so that users can use the stable paths
+ # GeoIP.dat/GeoIPCity.dat between labs and production
+ file { "$geoip_destdir/GeoIP.dat":
+ ensure => link,
+ target => 'GeoLite.dat',
+ }
+ file { "$geoip_destdir/GeoIPCity.dat":
+ ensure => link,
+ target => 'GeoLiteCity.dat',
+ }
+}
+
diff --git a/modules/puppet/manifests/self/gitclone.pp
b/modules/puppet/manifests/self/gitclone.pp
index 83e24f7..cd90684 100644
--- a/modules/puppet/manifests/self/gitclone.pp
+++ b/modules/puppet/manifests/self/gitclone.pp
@@ -4,6 +4,7 @@
#
class puppet::self::gitclone {
$gitdir = '/var/lib/git'
+ $volatiledir = '/var/lib/puppet/volatile'
file { $gitdir:
ensure => directory,
@@ -38,6 +39,18 @@
mode => '0600',
source => 'puppet:///private/ssh/labs-puppet-key',
}
+ file { $volatiledir:
+ ensure => directory,
+ owner => 'root',
+ group => 'puppet',
+ mode => '0750',
+ }
+ file { "${volatiledir}/misc":
+ ensure => directory,
+ owner => 'root',
+ group => 'puppet',
+ mode => '0750',
+ }
git::clone { 'operations/puppet':
directory => "${gitdir}/operations/puppet",
branch => 'production',
--
To view, visit https://gerrit.wikimedia.org/r/119555
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7d561d55cab5d0cad60d88d44fba56ba3562e9b7
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BryanDavis <[email protected]>
Gerrit-Reviewer: Andrew Bogott <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Ottomata <[email protected]>
Gerrit-Reviewer: coren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits