Cookbooks
keepalived
documentation
Keepalived Static Routes

keepalived_static_routes

back to resource list (opens in a new tab)

The keepalived_static_routes resource can be used to manage configuration within the static_routes section of keepalived.conf.

More information available at https://www.keepalived.org/manpage.html (opens in a new tab)

Actions

  • :create
  • :delete

Properties

NameTypeDefaultDescriptionAllowed Values
addressesArraynil(Required) A list of IP Address declarations
config_directoryString/etc/keepalived/conf.ddirectory for the config file to reside in
config_fileString::File.join(config_directory, 'static_routes.conf')full path to the config file
cookbookStringkeepalivedWhich cookbook to look in for the template
sourceStringstatic_routes.conf.erbName of the template to render

Examples

keepalived_static_routes 'static_routes' do
  routes [
    '192.168.2.0/24 via 192.168.1.100 dev eth0',
    '192.168.3.0/24 via 192.168.1.100 dev eth0',
  ]
  notifies :restart, 'service[keepalived]', :delayed
end