Dzahn has submitted this change and it was merged.

Change subject: puppetize haproxy (for brewster), the very basics (RT-4660)
......................................................................


puppetize haproxy (for brewster), the very basics (RT-4660)

I separated out the puppet haproxy.cfg file.  If you want to
use haproxy with your own config file, you can pass it to
the haproxy class. - otto

Change-Id: I2dbf4e28f8797988aa79073afceb21831fa29639
---
A files/puppet/haproxy.cfg
A manifests/misc/haproxy.pp
M manifests/site.pp
3 files changed, 63 insertions(+), 0 deletions(-)

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



diff --git a/files/puppet/haproxy.cfg b/files/puppet/haproxy.cfg
new file mode 100644
index 0000000..47a5c17
--- /dev/null
+++ b/files/puppet/haproxy.cfg
@@ -0,0 +1,33 @@
+# Note: This file is managed by puppet.
+
+# ha proxy configuration for forwarding to puppet
+
+global
+       log 127.0.0.1   local0
+       log 127.0.0.1   local1 notice
+       #log loghost    local0 info
+       maxconn 4096
+       #debug
+       #quiet
+       user haproxy
+       group haproxy
+
+defaults
+       log     global
+       mode    http
+       option  httplog
+       option  dontlognull
+       retries 3
+       option redispatch
+       maxconn 2000
+       contimeout      50000
+       clitimeout      500000
+       srvtimeout      500000
+
+listen puppet
+       bind :8140
+       mode tcp
+       balance roundrobin
+       #server sockpuppet 10.0.0.245
+       server stafford 10.0.0.24
+       acl esams src 91.198.174.0/24
diff --git a/manifests/misc/haproxy.pp b/manifests/misc/haproxy.pp
new file mode 100644
index 0000000..239b107
--- /dev/null
+++ b/manifests/misc/haproxy.pp
@@ -0,0 +1,24 @@
+# haproxy (RT-4660)
+
+class misc::haproxy($config_file = undef) {
+
+       system_role { 'misc::haproxy': description => 'haproxy host' }
+
+       package { 'haproxy': ensure => present; }
+
+       service { haproxy:
+               ensure  => running,
+               require => Package['haproxy'],
+       }
+
+       if ($config_file) {
+               file { '/etc/haproxy/haproxy.cfg':
+                       ensure => present,
+                       mode   => '0444',
+                       owner  => 'root',
+                       group  => 'root',
+                       source => $config_file,
+                       notify => Service['haproxy'],
+               }
+       }
+}
diff --git a/manifests/site.pp b/manifests/site.pp
index 1cad8f4..04a208c 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -208,6 +208,12 @@
        include standard,
                misc::install-server,
                backup::client
+
+       # set up brewster to use haproxy to proxy puppet
+       # to stafford.
+       class { 'misc::haproxy':
+               config_file =>  'puppet:///files/puppet/haproxy.cfg',
+       }
 }
 
 node "calcium.wikimedia.org" {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2dbf4e28f8797988aa79073afceb21831fa29639
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <dz...@wikimedia.org>
Gerrit-Reviewer: Dzahn <dz...@wikimedia.org>
Gerrit-Reviewer: Ottomata <o...@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