Jcrespo has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/391536 )
Change subject: haproxy: Update configuration template to haproxy 1.7 syntax
......................................................................
haproxy: Update configuration template to haproxy 1.7 syntax
Make stretch syntax conditionally, as we do not want to change
the versions on jessie (which will live alongside for some time)
for fear of breaking it.
Bug: T156844
Change-Id: Iaf742cc869f3ad78568c91f0ab30d08b45d6215f
---
M manifests/site.pp
M modules/role/manifests/mariadb/proxy/master.pp
A modules/role/templates/haproxy/db-master-stretch.cfg.erb
3 files changed, 26 insertions(+), 2 deletions(-)
Approvals:
Jcrespo: Verified; Looks good to me, approved
diff --git a/manifests/site.pp b/manifests/site.pp
index c492c41..8ec4057 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -678,7 +678,7 @@
}
}
-node /^dbproxy100(4|9)\.eqiad\.wmnet$/ {
+node 'dbproxy1004.eqiad.wmnet' {
class { '::role::mariadb::proxy::master':
shard => 'm4',
primary_name => 'db1046',
@@ -688,6 +688,17 @@
}
}
+# stretch haproxies (1.7) require the port number
+node 'dbproxy1009.eqiad.wmnet' {
+ class { '::role::mariadb::proxy::master':
+ shard => 'm4',
+ primary_name => 'db1046',
+ primary_addr => '10.64.16.35:3306',
+ secondary_name => 'db1047',
+ secondary_addr => '10.64.16.36:3306',
+ }
+}
+
node 'dbproxy1005.eqiad.wmnet' {
role(mariadb::ferm_wmcs)
class { '::role::mariadb::proxy::master':
diff --git a/modules/role/manifests/mariadb/proxy/master.pp
b/modules/role/manifests/mariadb/proxy/master.pp
index fb8be33..1770933 100644
--- a/modules/role/manifests/mariadb/proxy/master.pp
+++ b/modules/role/manifests/mariadb/proxy/master.pp
@@ -12,12 +12,17 @@
class { 'role::mariadb::proxy':
shard => $shard,
}
+ if os_version('debian >= stretch') {
+ $master_template = 'db-master-stretch.cfg'
+ } else {
+ $master_template = 'db-master.cfg'
+ }
file { '/etc/haproxy/conf.d/db-master.cfg':
owner => 'root',
group => 'root',
mode => '0444',
- content => template('role/haproxy/db-master.cfg.erb'),
+ content => template("role/haproxy/${master_template}"),
}
nrpe::monitor_service { 'haproxy_failover':
diff --git a/modules/role/templates/haproxy/db-master-stretch.cfg.erb
b/modules/role/templates/haproxy/db-master-stretch.cfg.erb
new file mode 100644
index 0000000..901ad7b
--- /dev/null
+++ b/modules/role/templates/haproxy/db-master-stretch.cfg.erb
@@ -0,0 +1,8 @@
+listen mariadb
+ bind 0.0.0.0:3306
+ mode tcp
+ balance roundrobin
+ option tcpka
+ option mysql-check user haproxy
+ server <%= @primary_name %> <%= @primary_addr %> check inter 3s fall 3
rise 99999999
+ server <%= @secondary_name %> <%= @secondary_addr %> check backup
--
To view, visit https://gerrit.wikimedia.org/r/391536
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iaf742cc869f3ad78568c91f0ab30d08b45d6215f
Gerrit-PatchSet: 7
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Jcrespo <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Jcrespo <[email protected]>
Gerrit-Reviewer: Marostegui <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits