Mark Bergsma has submitted this change and it was merged.

Change subject: Migrate class lvs::balancer to the new PyBal module
......................................................................


Migrate class lvs::balancer to the new PyBal module

Change-Id: I192fbf000dc36e2304d2dbfc3bdeab01a5afcbec
---
M manifests/lvs.pp
D templates/pybal/pybal.conf.erb
2 files changed, 6 insertions(+), 55 deletions(-)

Approvals:
  Mark Bergsma: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/lvs.pp b/manifests/lvs.pp
index 73a1a03..ac3ce4b 100644
--- a/manifests/lvs.pp
+++ b/manifests/lvs.pp
@@ -789,21 +789,18 @@
 
        require "lvs::configuration"
        include generic::sysfs::enable-rps
-
-       $lvs_class_hosts = $lvs::configuration::lvs_class_hosts
-       $pybal = $lvs::configuration::pybal
-       $lvs_services = $lvs::configuration::lvs_services
+       include pybal
 
        system_role { "lvs::balancer": description => "LVS balancer" }
 
-       package { [ ipvsadm, pybal, ethtool ]:
+       package { ethtool:
                ensure => installed;
        }
 
-       # Generate PyBal config file
-       file { "/etc/pybal/pybal.conf":
-               require => Package[pybal],
-               content => template("pybal/pybal.conf.erb");
+       class { 'pybal::configuration':
+               global_options => $lvs::configuration::pybal,
+               lvs_services => $lvs::configuration::lvs_services,
+               lvs_class_hosts => $lvs::configuration::lvs_class_hosts
        }
 
        # Tune the ip_vs conn_tab_bits parameter
diff --git a/templates/pybal/pybal.conf.erb b/templates/pybal/pybal.conf.erb
deleted file mode 100644
index 85e003f..0000000
--- a/templates/pybal/pybal.conf.erb
+++ /dev/null
@@ -1,46 +0,0 @@
-# PyBal configuration file
-# This file is managed by Puppet!
-
-[global]
-bgp = <%= pybal.fetch('bgp', "no") %>
-bgp-local-asn = 64600
-bgp-peer-address = <%= pybal['bgp-peer-address'] %>
-#bgp-as-path = 64600 64601
-bgp-nexthop-ipv4 = <%= pybal['bgp-nexthop-ipv4'] %>
-bgp-nexthop-ipv6 = <%= pybal['bgp-nexthop-ipv6'] %>
-
-#
-# LVS service definitions
-#
-
-<% lvs_services.sort.each do |servicename, service| -%>
-<% if 
lvs_class_hosts[service['class']].include?(scope.lookupvar("::hostname")) and 
service['sites'].include?(scope.lookupvar("::site")) then -%>
-<% if service['ip'].class.eql?(String) then
-service['ip'] = { servicename => service['ip'] }
-end -%>
-<% service['ip'].sort.each do |subservicename, subserviceip| -%>
-# SERVICE <%= subservicename %>
-# Class: <%= service['class'] %>
-# Description: <%= service['description'] %>
-# LVS balancers: <%= lvs_class_hosts[service['class']].join(" ") %>
-[<%= subservicename %>]
-protocol = <%= service.fetch('protocol', "tcp") %>
-ip = <%= subserviceip %>
-port = <%= service.fetch('port', 80) %>
-scheduler = <%= service.fetch('scheduler', "wrr") %>
-config = http://noc.wikimedia.org/pybal/<%= site %>/<%= servicename %>
-bgp = <%= service.fetch('bgp', "no") %>
-depool-threshold = <%= service.fetch('depool-threshold', ".5") %>
-monitors = <%= service['monitors'].keys.sort.inspect %>
-
-<% service['monitors'].sort.each do |monitorname, monitor| -%>
-# <%= monitorname %> monitor configuration
-<% monitor.each_pair do |param, value| -%>
-<%= monitorname.downcase %>.<%= param %> = <%= value.class == Array ? 
value.inspect : value %>
-<% end -%>
-<% end -%>
-
-<% end -%>
-
-<% end -%>
-<% end -%>

-- 
To view, visit https://gerrit.wikimedia.org/r/71993
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I192fbf000dc36e2304d2dbfc3bdeab01a5afcbec
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Mark Bergsma <m...@wikimedia.org>
Gerrit-Reviewer: Mark Bergsma <m...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to