Version information
This version is compatible with:
- Puppet Enterprise >=3.0.0 <=2015.4.0
- Puppet >=2.7.20 <5.0.0
- Gentoo, , ,
Start using this module
Add this module to your Puppetfile:
mod 'thias-keepalived', '1.0.5'
Learn more about managing modules with a PuppetfileDocumentation
puppet-keepalived
Overview
Install, enable and configure the keepalived VRRP and LVS management daemon.
keepalived
: Main class to install, enable and configure the service.keepalived::vrrp
: Wrapper class for VRRP-only keepalived setups.
The configuration file to be used can be specificed using either the $content
parameter (typically for templates), or the $source
parameter. If neither is
specified, you will need to manage it rom elsewhere.
See the templates/sysconfig.erb
file for the possible $options
values. The
default is -D
which enables both VRRP and LVS.
Examples
Typical installation for VRRP only (no LVS), using a static existing configuration file :
class { '::keepalived':
source => "puppet:///${module_name}/keepalived.conf",
options => '-D --vrrp',
}
Similar to the above, but using a template, which can be useful with multiple servers which will be part of the same VRRP group and/or have the same LVS configuration :
class { '::keepalived':
content => template("${module_name}/keepalived.conf.erb"),
}
For the keepalived::vrrp
class, configuration for the template needs to be
passed into the $global_defs
and $instances
hash parameters. Their
structure follows the structure of the keepalived.conf
file :
case $::hostname {
'web1': { $vrrp_state = 'MASTER' $vrrp_priority = '50' }
default: { $vrrp_state = 'BACKUP' $vrrp_priority = '10' }
}
class { '::keepalived::vrrp':
global_defs => {
router_id => $::hostname,
},
instances => {
web => {
advert_int => '3',
authentication => {
auth_type => 'PASS',
auth_pass => 'abcd1234',
},
interface => 'eth1',
priority => $vrrp_priority,
state => $vrrp_state,
virtual_ipaddress => {
'10.0.0.13/24' => 'dev eth0 label eth0:13',
'10.0.1.13/24' => 'dev eth1 label eth1:13',
},
virtual_router_id => '13',
},
},
}
Note that you may also set the $global_defs_defaults
parameter, which will
be merged with the more specific $global_defs
, which is especially useful
with hiera :
---
keepalived::vrrp::global_defs_defaults:
notification_email:
- 'root@example.com'
notification_email_from: 'root@example.com'
router_id: "%{::hostname}"
smtp_connect_timeout: '30'
smtp_server: '10.0.45.156'
2016-07-11 - 1.0.5
- Reload for service by default, as restart seems to often fail with LVS.
2015-04-29 - 1.0.4
- Add Debian support (#1, @nono-gdv).
2015-04-28 - 1.0.3
- I need to stop trying to make puppet-lint happy.
2015-04-28 - 1.0.2
- Make puppet-lint happy.
2015-04-28 - 1.0.1
- Add useful keepalived::vrrp wrapper class with typical template.
- Replace Modulefile with metadata.json.
2014-09-15 - 1.0.0
- Update README.
- Add package_ensure parameter, defaulting to 'installed'.
- Add 'Scientific' and 'Amazon' to params class.
2014-04-01 - 0.1.5
- Add service_enable and service_ensure parameters.
- Clean up params class and the way the sysconf file is installed.
2013-12-10 - 0.1.4
- Update Gentoo conf.d template for the 1.2.7 package.
2013-07-18 - 0.1.3
- Fix syntax error in the test.
- Fix missing @ prefix for the conf.d template variable.
2013-04-19 - 0.1.2
- Use @varname syntax in templates to silence puppet 3.2 warnings.
2013-03-21 - 0.1.1
- New params.pp in order to support Gentoo.
2013-03-08 - 0.1.0
- Update README and use markdown.
2012-08-29 - 0.0.1
- Start cleaning up existing class.
Copyright (C) 2012-2015 Matthias Saou 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.