Volans has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/345569 )
Change subject: Replace $::main_ipaddress by the new ipaddress fact
......................................................................
Replace $::main_ipaddress by the new ipaddress fact
$::main_ipaddress was a top-scope variable that was created in order to
address the shortcomings of the ipaddress fact. It didn't really pick up
and was only used in very few places across the tree.
The ipaddress (and ipaddress6) fact were replaced by our own
implementations that don't suffer from the same shortcomings. Replace
$::main_ipaddress with $::ipaddress (or $facts['ipaddress']) where
applicable.
Bug: T163196
Change-Id: I3fba82e5be3a59791e04dbb2d91f5525d3264cdd
---
M manifests/realm.pp
M modules/monitoring/manifests/host.pp
M modules/nrpe/templates/nrpe_local.cfg.erb
M modules/puppetmaster/manifests/puppetdb/database.pp
M modules/role/manifests/ci/slave.pp
5 files changed, 7 insertions(+), 20 deletions(-)
Approvals:
jenkins-bot: Verified
Volans: Looks good to me, approved
diff --git a/manifests/realm.pp b/manifests/realm.pp
index 5d3be45..b81b9be 100644
--- a/manifests/realm.pp
+++ b/manifests/realm.pp
@@ -4,15 +4,7 @@
# Determine the site the server is in
-if $facts['ipaddress_eth0'] {
- $main_ipaddress = $facts['ipaddress_eth0']
-} elsif $facts['ipaddress_bond0'] {
- $main_ipaddress = $facts['ipaddress_bond0']
-} else {
- $main_ipaddress = $facts['ipaddress']
-}
-
-$site = $main_ipaddress ? {
+$site = $facts['ipaddress'] ? {
/^208\.80\.15[23]\./ => 'codfw',
/^208\.80\.15[45]\./ => 'eqiad',
/^10\.6[48]\./ => 'eqiad',
@@ -62,7 +54,7 @@
$mw_primary = $app_routes['mediawiki']
$aqs_site = $app_routes['aqs']
-$network_zone = $main_ipaddress ? {
+$network_zone = $facts['ipaddress'] ? {
/^10./ => 'internal',
default => 'public'
}
diff --git a/modules/monitoring/manifests/host.pp
b/modules/monitoring/manifests/host.pp
index ce4da35..f121a4d 100644
--- a/modules/monitoring/manifests/host.pp
+++ b/modules/monitoring/manifests/host.pp
@@ -2,8 +2,8 @@
# Exports the resource that monitors hosts in icinga/shinken
#
define monitoring::host (
- $ip_address = $::main_ipaddress,
- $os = $::operatingsystem,
+ $ip_address = $facts['ipaddress'],
+ $os = $facts['operatingsystem'],
$host_fqdn = undef,
$group = undef,
$ensure = present,
diff --git a/modules/nrpe/templates/nrpe_local.cfg.erb
b/modules/nrpe/templates/nrpe_local.cfg.erb
index 59075f1..ba52ba5 100644
--- a/modules/nrpe/templates/nrpe_local.cfg.erb
+++ b/modules/nrpe/templates/nrpe_local.cfg.erb
@@ -2,11 +2,6 @@
# We override allowed_hosts from nrpe.cfg here
allowed_hosts=<%= @allowed_hosts %>
-# Bind only to the primary (management) IP address and not one of the service
addresses
-# An assumption is made here that ipaddress fact will have the management
address and not
-# a service address
-<% if scope.lookupvar('::main_ipaddress') %>
-server_address=<%= scope.lookupvar('::main_ipaddress') %>
-<% end -%>
+server_address=<%= @ipaddress %>
command[check_ram]=/usr/lib/nagios/plugins/check_ram.sh 20 5 b
diff --git a/modules/puppetmaster/manifests/puppetdb/database.pp
b/modules/puppetmaster/manifests/puppetdb/database.pp
index 0385e26..6af3f13 100644
--- a/modules/puppetmaster/manifests/puppetdb/database.pp
+++ b/modules/puppetmaster/manifests/puppetdb/database.pp
@@ -42,7 +42,7 @@
user => 'puppetdb',
database => 'puppetdb',
password => $puppetdb_pass,
- cidr => "${::main_ipaddress}/32",
+ cidr => "${::ipaddress}/32",
pgversion => '9.4',
master => $on_master,
}
diff --git a/modules/role/manifests/ci/slave.pp
b/modules/role/manifests/ci/slave.pp
index b1e242b..9de9244 100644
--- a/modules/role/manifests/ci/slave.pp
+++ b/modules/role/manifests/ci/slave.pp
@@ -15,7 +15,7 @@
class { 'jenkins::slave':
# Master connect to itself via the fqdn / primary IP ipaddress
- ssh_key => "ssh-rsa
AAAAB3NzaC1yc2EAAAABIwAAAQEA4QGc1Zs/S4s7znEYw7RifTuZ4y4iYvXl5jp5tJA9kGUGzzfL0dc4ZEEhpu+4C/TixZJXqv0N6yke67cM8hfdXnLOVJc4n/Z02uYHQpRDeLAJUAlGlbGZNvzsOLw39dGF0u3YmwDm6rj85RSvGqz8ExbvrneCVJSaYlIRvOEKw0e0FYs8Yc7aqFRV60M6fGzWVaC3lQjSnEFMNGdSiLp3Vl/GB4GgvRJpbNENRrTS3Te9BPtPAGhJVPliTflVYvULCjYVtPEbvabkW+vZznlcVHAZJVTTgmqpDZEHqp4bzyO8rBNhMc7BjUVyNVNC5FCk+D2LagmIriYxjirXDNrWlw==
jenkins@gallium from=\"${::main_ipaddress}\"",
+ ssh_key => "ssh-rsa
AAAAB3NzaC1yc2EAAAABIwAAAQEA4QGc1Zs/S4s7znEYw7RifTuZ4y4iYvXl5jp5tJA9kGUGzzfL0dc4ZEEhpu+4C/TixZJXqv0N6yke67cM8hfdXnLOVJc4n/Z02uYHQpRDeLAJUAlGlbGZNvzsOLw39dGF0u3YmwDm6rj85RSvGqz8ExbvrneCVJSaYlIRvOEKw0e0FYs8Yc7aqFRV60M6fGzWVaC3lQjSnEFMNGdSiLp3Vl/GB4GgvRJpbNENRrTS3Te9BPtPAGhJVPliTflVYvULCjYVtPEbvabkW+vZznlcVHAZJVTTgmqpDZEHqp4bzyO8rBNhMc7BjUVyNVNC5FCk+D2LagmIriYxjirXDNrWlw==
jenkins@gallium from=\"${::ipaddress}\"",
user => 'jenkins-slave',
workdir => '/srv/jenkins-slave',
}
--
To view, visit https://gerrit.wikimedia.org/r/345569
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3fba82e5be3a59791e04dbb2d91f5525d3264cdd
Gerrit-PatchSet: 9
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: Alexandros Kosiaris <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Volans <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits