Skip to content

Commit

Permalink
Update tripleo to a388f84654701f5d6604e0833a6a8fe1b90fcfdd
Browse files Browse the repository at this point in the history
a388f84654701f5d6604e0833a6a8fe1b90fcfdd Merge "Make setup of keepalived optional via manage_vip parameter"
a3d93790c284863d9b4bc32eae8dd35c6e6cb68c Merge "Bump rspec-puppet to 2.1.0"
d6405961b49147499574d7ceea3f57c0f48d06f9 Bump rspec-puppet to 2.1.0
20fad5ae9117f529fdc5e0ad15aca78c6a3a59f7 Merge "Enable access to HAProxy stats page"
93b309b2f3b897e1b55634f576706f81b8ccb2e1 Merge "Add $::galera_bootstrapped fact"
ec7667b43c4d8dd5fb8222c3ddd9572e08477390 Merge "Do not make RabbitMQ listen on public vip"
70cb73ca6e53cbca3a841a67d2bb1644461754c6 Do not make RabbitMQ listen on public vip
8c29315cbcd5e255e1287e86cd8134590b9e7d06 Make setup of keepalived optional via manage_vip parameter
dfcb703bce19c8cc9113c294295de977c51c8e7c Enable access to HAProxy stats page
9ad337d15e7e3305c0872aee231f75e7af55e889 Add $::galera_bootstrapped fact

Change-Id: Ia4e32678ad7e5e58e92384e942d41e68561d07d0
  • Loading branch information
xbezdick committed May 4, 2015
1 parent 8f72f0a commit f2ef8aa
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ mod 'timezone',
:git => 'https://github.com/saz/puppet-timezone.git'

mod 'tripleo',
:commit => 'e0921709d946d8db95f2a399a1b9da93d6b73d06',
:commit => 'a388f84654701f5d6604e0833a6a8fe1b90fcfdd',
:git => 'https://github.com/stackforge/puppet-tripleo.git'

mod 'trove',
Expand Down
2 changes: 1 addition & 1 deletion tripleo/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source 'https://rubygems.org'

group :development, :test do
gem 'puppetlabs_spec_helper', :require => false
gem 'rspec-puppet', '~> 2.0.0', :require => false
gem 'rspec-puppet', '~> 2.1.0', :require => false

gem 'metadata-json-lint'
gem 'puppet-lint-param-docs'
Expand Down
19 changes: 19 additions & 0 deletions tripleo/lib/facter/galera_bootstrapped.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2015 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
Facter.add('galera_bootstrapped') do
setcode do
FileTest.exists?('/var/lib/mysql/grastate.dat')
end
end
87 changes: 47 additions & 40 deletions tripleo/manifests/loadbalancer.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#
# === Parameters:
#
# [*manage_vip*]
# Whether to enable keepalived to manage the VIPs or not
# Defaults to true
#
# [*controller_host*]
# (Deprecated)Host or group of hosts to load-balance the services
# Can be a string or an array.
Expand Down Expand Up @@ -143,6 +147,7 @@
$control_virtual_interface,
$public_virtual_interface,
$public_virtual_ip,
$manage_vip = true,
$controller_host = undef,
$controller_hosts = undef,
$controller_hosts_names = undef,
Expand Down Expand Up @@ -185,46 +190,48 @@
$controller_hosts_names_real = $controller_hosts_names
}

case $::osfamily {
'RedHat': {
$keepalived_name_is_process = false
$keepalived_vrrp_script = 'systemctl status haproxy.service'
} # RedHat
'Debian': {
$keepalived_name_is_process = true
$keepalived_vrrp_script = undef
}
default: {
warning('Please configure keepalived defaults in tripleo::loadbalancer.')
$keepalived_name_is_process = undef
$keepalived_vrrp_script = undef
if $manage_vip {
case $::osfamily {
'RedHat': {
$keepalived_name_is_process = false
$keepalived_vrrp_script = 'systemctl status haproxy.service'
} # RedHat
'Debian': {
$keepalived_name_is_process = true
$keepalived_vrrp_script = undef
}
default: {
warning('Please configure keepalived defaults in tripleo::loadbalancer.')
$keepalived_name_is_process = undef
$keepalived_vrrp_script = undef
}
}

class { '::keepalived': }
keepalived::vrrp_script { 'haproxy':
name_is_process => $keepalived_name_is_process,
script => $keepalived_vrrp_script,
}

# KEEPALIVE INSTANCE CONTROL
keepalived::instance { '51':
interface => $control_virtual_interface,
virtual_ips => [join([$controller_virtual_ip, ' dev ', $control_virtual_interface])],
state => 'MASTER',
track_script => ['haproxy'],
priority => 101,
}

# KEEPALIVE INSTANCE PUBLIC
keepalived::instance { '52':
interface => $public_virtual_interface,
virtual_ips => [join([$public_virtual_ip, ' dev ', $public_virtual_interface])],
state => 'MASTER',
track_script => ['haproxy'],
priority => 101,
}
}

class { '::keepalived': }
keepalived::vrrp_script { 'haproxy':
name_is_process => $keepalived_name_is_process,
script => $keepalived_vrrp_script,
}

# KEEPALIVE INSTANCE CONTROL
keepalived::instance { '51':
interface => $control_virtual_interface,
virtual_ips => [join([$controller_virtual_ip, ' dev ', $control_virtual_interface])],
state => 'MASTER',
track_script => ['haproxy'],
priority => 101,
}

# KEEPALIVE INSTANCE PUBLIC
keepalived::instance { '52':
interface => $public_virtual_interface,
virtual_ips => [join([$public_virtual_ip, ' dev ', $public_virtual_interface])],
state => 'MASTER',
track_script => ['haproxy'],
priority => 101,
}

sysctl::value { 'net.ipv4.ip_nonlocal_bind': value => '1' }

class { '::haproxy':
Expand All @@ -247,11 +254,11 @@
}

haproxy::listen { 'haproxy.stats':
ipaddress => '*',
ipaddress => $controller_virtual_ip,
ports => '1993',
mode => 'http',
options => {
'stats' => 'enable',
'stats' => ['enable', 'uri /'],
},
collect_exported => false,
}
Expand Down Expand Up @@ -572,7 +579,7 @@

if $rabbitmq {
haproxy::listen { 'rabbitmq':
ipaddress => [$controller_virtual_ip, $public_virtual_ip],
ipaddress => [$controller_virtual_ip],
ports => 5672,
options => {
'timeout' => [ 'client 0', 'server 0' ],
Expand Down

0 comments on commit f2ef8aa

Please sign in to comment.