From 8db634e01a7d66e53c3d56f480ae7f01b283819a Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 18:56:24 -0400 Subject: [PATCH 01/33] Setting up the new macro. --- keepalived/templates/keepalived.jinja | 237 ++------------------------ 1 file changed, 12 insertions(+), 225 deletions(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 57db711..081c8f7 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -5,229 +5,16 @@ # This file is managed by Salt. # Any changes will be overwritten. +{%- import_yaml 'keepalived/defaults.yaml' as keepalived_defaults %} +{%- set keepalived_final_values = salt.pillar.get( + 'keepalived', + default=keepalived_defaults, + merge=True) %} -#--------------------------------------------------------------------- -# Global settings -#--------------------------------------------------------------------- -global_defs { - notification_email { -{%- if 'notification_emails' in salt['pillar.get']('keepalived:global_defs') %} - {%- for email in salt['pillar.get']('keepalived:global_defs:notification_emails', []) %} - {{ email }} - {%- endfor %} -{%- endif %} - } - notification_email_from {{ salt['pillar.get']('keepalived:global_defs:notification_email_from', 'keepalived@'~salt['grains.get']('fqdn') ) }} - smtp_server {{ salt['pillar.get']('keepalived:global_defs:smtp_server', 'localhost') }} -{%- if 'smtp_connect_timeout' in salt['pillar.get']('keepalived:global_defs') %} - smtp_connect_timeout {{ salt['pillar.get']('keepalived:global_defs:smtp_connect_timeout') }} -{%- endif %} -} - -#--------------------------------------------------------------------- -# static network configuration -#--------------------------------------------------------------------- -# static ipaddresses -{%- if 'static_ipaddresses' in salt['pillar.get']('keepalived') %} -static_ipaddress { - {%- for address in salt['pillar.get']('keepalived:static_ipaddresses', {}).iteritems() %} - {{ address }} - {%- endfor %} -} -{%- endif %} - -# static routes -{%- if 'static_routes' in salt['pillar.get']('keepalived') %} -static_routes { - {%- for route in salt['pillar.get']('keepalived:static_routes', {}).iteritems() %} - {{ route}} - {%- endfor %} -} -{%- endif %} - -#--------------------------------------------------------------------- -# vrrp configuration -#--------------------------------------------------------------------- - -# vrrp scripts -{%- for script in salt['pillar.get']('keepalived:vrrp_scripts', {}).iteritems() %} -vrrp_script {{ script[1].get('name', script[0]) }} { - script "{{ script[1].get('script') }}" - interval {{ script[1].get('interval', '1') }} - weight {{ script[1].get('weight', '2') }} - {%- if 'fall' in script[1] %} - fall {{ script[1].get('fall') }} - {%- endif %} - {%- if 'rise' in script[1] %} - rise {{ script[1].get('rise') }} - {%- endif %} -} -{%- endfor %} - -# vrrp sync groups -{%- if 'vrrp_sync_groups' in salt['pillar.get']('keepalived') %} - {%- for syncgroup in salt['pillar.get']('keepalived:vrrp_sync_groups', {}).iteritems() %} -vrrp_sync_group {{ syncgroup[1].get('name', syncgroup[0]) }} { - group { - {%- for member in syncgroup[1].members %} - {{ member }} - {%- endfor%} - } - {%- if 'notify_master' in syncgroup[1] %} - notify_master {{ syncgroup[1].get('notify_master') }} - {%- endif %} - {%- if 'notify_backup' in syncgroup[1] %} - notify_backup {{ syncgroup[1].get('notify_backup') }} - {%- endif %} - {%- if 'notify_fault' in syncgroup[1] %} - notify_master {{ syncgroup[1].get('notify_fault') }} - {%- endif %} - {%- if 'notify' in syncgroup[1] %} - notify {{ syncgroup[1].get('notify') }} - {%- endif %} - {%- if 'smtp_alert' in syncgroup[1] %} - {%- if True == syncgroup[1].get('smtp_alert') %} - smtp_alert - {%- endif %} - {%- endif %} -} - {%- endfor %} -{%- endif %} - -# vrrp instance -{%- for instance in salt['pillar.get']('keepalived:vrrp_instances', {}).iteritems() %} -vrrp_instance {{ instance[1].get('name', instance[0]) }} { - {%- if 'use_vmac' in instance[1] %} - {%- if True == instance[1].get('use_vmac') %} - use_vmac - {%- endif %} - {%- endif %} - {%- if 'vmac_xmit_base' in instance[1] %} - {%- if True == instance[1].get('vmac_xmit_base') %} - vmac_xmit_base - {%- endif %} - {%- endif %} - {%- if 'native_ipv6' in instance[1] %} - {%- if True == instance[1].get('native_ipv6') %} - native_ipv6 - {%- endif %} - {%- endif %} - state {{ instance[1].get('state', 'BACKUP') }} - {%- if 'interface' in instance[1] %} - interface {{ instance[1].get('interface') }} - {%- endif %} - {%- if 'track_interfaces' in instance[1] %} - track_interface { - {%- for track_interface in instance[1].track_interfaces %} - {{ track_interface }} - {%- endfor%} - } - {%- endif %} - {%- if 'track_scripts' in instance[1] %} - track_script { - {%- for track_script in instance[1].track_scripts %} - {{ track_script }} - {%- endfor%} - } - {%- endif %} - {%- if 'dont_track_primary' in instance[1] and instance[1].get('dont_track_primary') %} - dont_track_primary - {%- endif %} - {%- if 'mcast_src_ip' in instance[1] %} - mcast_src_ip {{ instance[1].get('mcast_src_ip') }} - {%- endif %} - {%- if 'unicast_src_ip' in instance[1] %} - unicast_src_ip {{ instance[1].get('unicast_src_ip') }} - {%- endif %} - {%- if 'unicast_peers' in instance[1] %} - unicast_peer { - {%- for unicast_peer in instance[1].unicast_peers %} - {{ unicast_peer }} - {%- endfor%} - } - {%- endif %} - {%- if 'lvs_sync_daemon_interface' in instance[1] %} - lvs_sync_daemon_interface {{ instance[1].get('lvs_sync_daemon_interface') }} - {%- endif %} - {%- if 'garp_master_delay' in instance[1] %} - garp_master_delay {{ instance[1].get('garp_master_delay') }} - {%- endif %} - {%- if 'garp_master_repeat' in instance[1] %} - garp_master_repeat {{ instance[1].get('garp_master_repeat') }} - {%- endif %} - {%- if 'garp_master_refresh' in instance[1] %} - garp_master_refresh {{ instance[1].get('garp_master_refresh') }} - {%- endif %} - {%- if 'garp_master_refresh_repeat' in instance[1] %} - garp_master_refresh_repeat {{ instance[1].get('garp_master_refresh_repeat') }} - {%- endif %} - {%- if 'virtual_router_id' in instance[1] %} - virtual_router_id {{ instance[1].get('virtual_router_id') }} - {%- endif %} - {%- if 'priority' in instance[1] %} - priority {{ instance[1].get('priority') }} - {%- endif %} - {%- if 'advert_int' in instance[1] %} - advert_int {{ instance[1].get('advert_int') }} - {%- endif %} - authentication { - auth_type {{ instance[1].get('authentication').get('auth_type') }} - auth_pass {{ instance[1].get('authentication').get('auth_pass') }} - } - {%- if 'virtual_ipaddresses' in instance[1] %} - virtual_ipaddress { - {%- for virtual_ipaddress in instance[1].virtual_ipaddresses %} - {{ virtual_ipaddress }} - {%- endfor%} - } - {%- endif %} - {%- if 'virtual_ipaddresses_excluded' in instance[1] %} - virtual_ipaddress_excluded { - {%- for virtual_ipaddress_excluded in instance[1].virtual_ipaddresses_excluded %} - {{ virtual_ipaddress_excluded }} - {%- endfor%} - } - {%- endif %} - {%- if 'virtual_routes' in instance[1] %} - virtual_routes { - {%- for virtual_route in instance[1].virtual_routes %} - {{ virtual_route }} - {%- endfor%} - {%- if 'blackhole_addresses' in instance[1] %} - {%- for blackhole_address in instance[1].blackhole_addresses %} - blackhole {{ blackhole_address }} - {%- endfor%} - {%- endif %} - } - {%- endif %} - {%- if 'nopreempt' in instance[1] and instance[1].get('nopreempt') %} - nopreempt - {%- endif %} - {%- if 'notify_master' in instance[1] %} - notify_master {{ instance[1].get('notify_master') }} - {%- endif %} - {%- if 'notify_backup' in instance[1] %} - notify_backup {{ instance[1].get('notify_backup') }} - {%- endif %} - {%- if 'notify_fault' in instance[1] %} - notify_fault {{ instance[1].get('notify_fault') }} - {%- endif %} - {%- if 'notify_stop' in instance[1] %} - notify_stop {{ instance[1].get('notify_stop') }} - {%- endif %} - {%- if 'notify' in instance[1] %} - notify {{ instance[1].get('notify') }} - {%- endif %} - {%- if 'smtp_alert' in instance[1] %} - {%- if True == instance[1].get('smtp_alert') %} - smtp_alert - {%- endif %} - {%- endif %} -} -{%- endfor %} - -#--------------------------------------------------------------------- -# lvs configuration -#--------------------------------------------------------------------- -#this section has not been completed - +{%- macro config_entries(data) -%} + {%- if data is mapping -%} + {%- for entry_type in data|dictsort -%} +{{ entry_type }} + {%- endfor -%} + {%- endif -%} +{%- endmacro -%} From 351e9f904cc4dedfd3d7432586a444af0b0d284e Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 18:58:39 -0400 Subject: [PATCH 02/33] Added the defaults file. --- keepalived/defaults.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 keepalived/defaults.yaml diff --git a/keepalived/defaults.yaml b/keepalived/defaults.yaml new file mode 100644 index 0000000..65a9acd --- /dev/null +++ b/keepalived/defaults.yaml @@ -0,0 +1,6 @@ +--- +# keepalived/defaults.yaml + +keepalived: + global_defs: + smtp_server: localhost From 308cf7b22f99191bb6a58da00b72c6ddd1742977 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 19:03:11 -0400 Subject: [PATCH 03/33] Using the macro function. --- keepalived/templates/keepalived.jinja | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 081c8f7..f0cbf3e 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -14,7 +14,9 @@ {%- macro config_entries(data) -%} {%- if data is mapping -%} {%- for entry_type in data|dictsort -%} -{{ entry_type }} +{{ entry_type }}{{ '\n' }} {%- endfor -%} {%- endif -%} {%- endmacro -%} + +[%- config_entries(keepalived_final_values) -%} From 409d5357f650576d43d877527d272a2326c4178f Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 19:05:43 -0400 Subject: [PATCH 04/33] Corrected typo. --- keepalived/templates/keepalived.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index f0cbf3e..a70696b 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -19,4 +19,4 @@ {%- endif -%} {%- endmacro -%} -[%- config_entries(keepalived_final_values) -%} +{%- config_entries(keepalived_final_values) -%} From 0019a1bc95c32995a8cbcf6f1a627edf3afce25e Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 19:09:34 -0400 Subject: [PATCH 05/33] Corrected typo. --- keepalived/templates/keepalived.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index a70696b..5fe5c23 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -19,4 +19,4 @@ {%- endif -%} {%- endmacro -%} -{%- config_entries(keepalived_final_values) -%} +{{ config_entries(keepalived_final_values) }} From 762129427e71d46dc7aeef1143ddfa688bdf7100 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 19:17:58 -0400 Subject: [PATCH 06/33] Making the macro recursive. --- keepalived/templates/keepalived.jinja | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 5fe5c23..899aff7 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -4,17 +4,19 @@ # # This file is managed by Salt. # Any changes will be overwritten. - +{{ '\n' }} {%- import_yaml 'keepalived/defaults.yaml' as keepalived_defaults %} {%- set keepalived_final_values = salt.pillar.get( - 'keepalived', + 'keepalived:', default=keepalived_defaults, merge=True) %} {%- macro config_entries(data) -%} {%- if data is mapping -%} {%- for entry_type in data|dictsort -%} -{{ entry_type }}{{ '\n' }} +{{ entry_type }} { +{{ config_entries(data[entry_type]) }} +}{{ '\n' }} {%- endfor -%} {%- endif -%} {%- endmacro -%} From 0404d8a8b9471df08929dbb42f7f9f31b0b7e65d Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 19:29:26 -0400 Subject: [PATCH 07/33] Corrected the defaults. --- keepalived/defaults.yaml | 5 ++--- keepalived/templates/keepalived.jinja | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/keepalived/defaults.yaml b/keepalived/defaults.yaml index 65a9acd..4e477bd 100644 --- a/keepalived/defaults.yaml +++ b/keepalived/defaults.yaml @@ -1,6 +1,5 @@ --- # keepalived/defaults.yaml -keepalived: - global_defs: - smtp_server: localhost +global_defs: + smtp_server: localhost diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 899aff7..20b95d6 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -7,7 +7,7 @@ {{ '\n' }} {%- import_yaml 'keepalived/defaults.yaml' as keepalived_defaults %} {%- set keepalived_final_values = salt.pillar.get( - 'keepalived:', + 'keepalived', default=keepalived_defaults, merge=True) %} From 9de2e18c3eb898e5bc34275b223eacf7c57211c2 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 19:35:40 -0400 Subject: [PATCH 08/33] Getting the data entry correct. --- keepalived/templates/keepalived.jinja | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 20b95d6..bf582fd 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -13,9 +13,9 @@ {%- macro config_entries(data) -%} {%- if data is mapping -%} - {%- for entry_type in data|dictsort -%} -{{ entry_type }} { -{{ config_entries(data[entry_type]) }} + {%- for entry in data|dictsort -%} +{{ entry[0] }} { +{{ config_entries(entry[1]) }} }{{ '\n' }} {%- endfor -%} {%- endif -%} From 75f971ae714152438d28dee5a1d287a5d029b679 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 19:44:51 -0400 Subject: [PATCH 09/33] Adding indents. --- keepalived/templates/keepalived.jinja | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index bf582fd..a9e216f 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -11,14 +11,14 @@ default=keepalived_defaults, merge=True) %} -{%- macro config_entries(data) -%} +{%- macro config_entries(data, indents) -%} {%- if data is mapping -%} {%- for entry in data|dictsort -%} -{{ entry[0] }} { -{{ config_entries(entry[1]) }} +{{ entry[0]|indent(indents, True) }} { +{{ config_entries(entry[1], indents + 2) }} }{{ '\n' }} {%- endfor -%} {%- endif -%} {%- endmacro -%} -{{ config_entries(keepalived_final_values) }} +{{ config_entries(keepalived_final_values, 0) }} From aaedc00343563e669ba01b45ed48c576863bc6c9 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 19:48:34 -0400 Subject: [PATCH 10/33] Added the tail indents. --- keepalived/templates/keepalived.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index a9e216f..31f498b 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -16,7 +16,7 @@ {%- for entry in data|dictsort -%} {{ entry[0]|indent(indents, True) }} { {{ config_entries(entry[1], indents + 2) }} -}{{ '\n' }} +{{ '}\n'|indent(indents, True) }} {%- endfor -%} {%- endif -%} {%- endmacro -%} From 56aabbb31a4f82238ddf5ba657764a3ea69561f4 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 19:51:26 -0400 Subject: [PATCH 11/33] Corrected the tail indents. --- keepalived/templates/keepalived.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 31f498b..b95d26e 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -16,7 +16,7 @@ {%- for entry in data|dictsort -%} {{ entry[0]|indent(indents, True) }} { {{ config_entries(entry[1], indents + 2) }} -{{ '}\n'|indent(indents, True) }} +{{ '}'|indent(indents, True) }}{{ '\n' }} {%- endfor -%} {%- endif -%} {%- endmacro -%} From 12a9447c004d739daf7fe69d2055e0eeffe76c0d Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 20:02:12 -0400 Subject: [PATCH 12/33] Tried adding the data information. --- keepalived/templates/keepalived.jinja | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index b95d26e..0b0e2a6 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -12,10 +12,12 @@ merge=True) %} {%- macro config_entries(data, indents) -%} - {%- if data is mapping -%} + {%- if data is string or data is number -%} +{{- " " }}{{ data }} + {%- elif data is mapping -%} {%- for entry in data|dictsort -%} {{ entry[0]|indent(indents, True) }} { -{{ config_entries(entry[1], indents + 2) }} +{{- config_entries(entry[1], indents + 2) -}} {{ '}'|indent(indents, True) }}{{ '\n' }} {%- endfor -%} {%- endif -%} From 77ed019bfe47fdd6027850156a0830145883f1a2 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 20:11:55 -0400 Subject: [PATCH 13/33] Removing the excess borders. --- keepalived/templates/keepalived.jinja | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 0b0e2a6..44a2fcc 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -14,12 +14,15 @@ {%- macro config_entries(data, indents) -%} {%- if data is string or data is number -%} {{- " " }}{{ data }} - {%- elif data is mapping -%} - {%- for entry in data|dictsort -%} -{{ entry[0]|indent(indents, True) }} { + {%- else -%} +{{- " {" -}} + {%- if data is mapping -%} + {%- for entry in data|dictsort -%} +{{ entry[0]|indent(indents, True) }} {{- config_entries(entry[1], indents + 2) -}} + {%- endfor -%} + {%- endif -%} {{ '}'|indent(indents, True) }}{{ '\n' }} - {%- endfor -%} {%- endif -%} {%- endmacro -%} From 4d65dc5b40403b525c3c4fe8b996c499c1c1884c Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 20:15:45 -0400 Subject: [PATCH 14/33] Getting the returns correct. --- keepalived/templates/keepalived.jinja | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 44a2fcc..00b74a0 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -13,9 +13,9 @@ {%- macro config_entries(data, indents) -%} {%- if data is string or data is number -%} -{{- " " }}{{ data }} +{{- " " }}{{ data }}{{ '\n' }} {%- else -%} -{{- " {" -}} +{{- " {\n" -}} {%- if data is mapping -%} {%- for entry in data|dictsort -%} {{ entry[0]|indent(indents, True) }} From d7a27a99b132e0f2dcc6a22da77d48ae8fba211d Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 20:23:47 -0400 Subject: [PATCH 15/33] Removed the unwanted exterior brackets. --- keepalived/templates/keepalived.jinja | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 00b74a0..744c54a 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -15,14 +15,18 @@ {%- if data is string or data is number -%} {{- " " }}{{ data }}{{ '\n' }} {%- else -%} + {%- if indents != 0 -%} {{- " {\n" -}} + {%- endif -%} {%- if data is mapping -%} {%- for entry in data|dictsort -%} {{ entry[0]|indent(indents, True) }} {{- config_entries(entry[1], indents + 2) -}} {%- endfor -%} {%- endif -%} -{{ '}'|indent(indents, True) }}{{ '\n' }} + {%- if indents != 0 -%} +{{ '}'|indent(indents - 2, True) }}{{ '\n' }} + {%- endif -%} {%- endif -%} {%- endmacro -%} From 7e9901dc478a54d545402fede317de2e9b1d67c1 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 20:37:27 -0400 Subject: [PATCH 16/33] Add list items. --- keepalived/templates/keepalived.jinja | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 744c54a..0640608 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -23,6 +23,10 @@ {{ entry[0]|indent(indents, True) }} {{- config_entries(entry[1], indents + 2) -}} {%- endfor -%} + {%- else -%} + {%- for entry in data -%} +{{- config_entries(entry, indents + 2) -}} + {%- endfor -%} {%- endif -%} {%- if indents != 0 -%} {{ '}'|indent(indents - 2, True) }}{{ '\n' }} From 2fe783a595a2899cfb8ccec625383462362f2e2a Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 20:43:55 -0400 Subject: [PATCH 17/33] Correcting the indentation. --- keepalived/templates/keepalived.jinja | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 0640608..bead6cc 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -13,14 +13,14 @@ {%- macro config_entries(data, indents) -%} {%- if data is string or data is number -%} -{{- " " }}{{ data }}{{ '\n' }} +{{ data|indent(indents, True) }}{{ '\n' }} {%- else -%} {%- if indents != 0 -%} {{- " {\n" -}} {%- endif -%} {%- if data is mapping -%} {%- for entry in data|dictsort -%} -{{ entry[0]|indent(indents, True) }} +{{ entry[0]|indent(indents, True) }}{{ ' ' }} {{- config_entries(entry[1], indents + 2) -}} {%- endfor -%} {%- else -%} From 45583297427cf0ff39ac1332ef2a89ef6cfcbdfb Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 20:50:06 -0400 Subject: [PATCH 18/33] Correcting the indentation. --- keepalived/templates/keepalived.jinja | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index bead6cc..142b691 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -5,15 +5,15 @@ # This file is managed by Salt. # Any changes will be overwritten. {{ '\n' }} -{%- import_yaml 'keepalived/defaults.yaml' as keepalived_defaults %} +{%- import_yaml 'keepalived/defaults.yaml' as keepalived_defaults -%} {%- set keepalived_final_values = salt.pillar.get( 'keepalived', default=keepalived_defaults, - merge=True) %} + merge=True) -%} {%- macro config_entries(data, indents) -%} {%- if data is string or data is number -%} -{{ data|indent(indents, True) }}{{ '\n' }} +{{ string(data)|indent(indents, True) }}{{ '\n' }} {%- else -%} {%- if indents != 0 -%} {{- " {\n" -}} From 35f7294ea991d65fa3c38564a1e35ac23ded533a Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 20:53:01 -0400 Subject: [PATCH 19/33] Correcting the indentation. --- keepalived/templates/keepalived.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 142b691..92e90bb 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -13,7 +13,7 @@ {%- macro config_entries(data, indents) -%} {%- if data is string or data is number -%} -{{ string(data)|indent(indents, True) }}{{ '\n' }} +{{ data|string|indent(indents, True) }}{{ '\n' }} {%- else -%} {%- if indents != 0 -%} {{- " {\n" -}} From 42cde887c8420d8ff47ef408eaac271616ae32f0 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 21:03:24 -0400 Subject: [PATCH 20/33] Correcting the indentation. --- keepalived/templates/keepalived.jinja | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 92e90bb..c967cb8 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -16,7 +16,7 @@ {{ data|string|indent(indents, True) }}{{ '\n' }} {%- else -%} {%- if indents != 0 -%} -{{- " {\n" -}} +{{- "{\n" -}} {%- endif -%} {%- if data is mapping -%} {%- for entry in data|dictsort -%} @@ -25,7 +25,7 @@ {%- endfor -%} {%- else -%} {%- for entry in data -%} -{{- config_entries(entry, indents + 2) -}} +{{- config_entries(entry, indents) -}} {%- endfor -%} {%- endif -%} {%- if indents != 0 -%} From 948e4eede5aefd786bdae750285c2d7a622a31b5 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 21:09:30 -0400 Subject: [PATCH 21/33] Removed the unnecessary space. --- keepalived/templates/keepalived.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index c967cb8..60bf7c3 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -20,7 +20,7 @@ {%- endif -%} {%- if data is mapping -%} {%- for entry in data|dictsort -%} -{{ entry[0]|indent(indents, True) }}{{ ' ' }} +{{ entry[0]|indent(indents, True) }} {{- config_entries(entry[1], indents + 2) -}} {%- endfor -%} {%- else -%} From 8fb48f722567ce7866e5cf09005fc82346498430 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 22:01:51 -0400 Subject: [PATCH 22/33] Getting the special entries added. --- keepalived/templates/keepalived.jinja | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 60bf7c3..52d8f53 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -11,24 +11,30 @@ default=keepalived_defaults, merge=True) -%} -{%- macro config_entries(data, indents) -%} +{%- set groupings = ['vrrp_script', 'vrrp_sync_group', 'vrrp_instance', + 'virtual_server_group', 'virtual_server', 'real_server'] -%} +{%- macro config_entries(data, indents, carryover='') -%} {%- if data is string or data is number -%} {{ data|string|indent(indents, True) }}{{ '\n' }} {%- else -%} - {%- if indents != 0 -%} + {%- if indents != 0 and not carryover -%} {{- "{\n" -}} {%- endif -%} {%- if data is mapping -%} {%- for entry in data|dictsort -%} + {%- if entry[0] in groupings -%} +{{- config_entries(entry[1], indents + 2, carryover=entry[0]) -}} + {%- else -%} {{ entry[0]|indent(indents, True) }} {{- config_entries(entry[1], indents + 2) -}} + {%- endif -%} {%- endfor -%} {%- else -%} {%- for entry in data -%} {{- config_entries(entry, indents) -}} {%- endfor -%} {%- endif -%} - {%- if indents != 0 -%} + {%- if indents != 0 and not carryover -%} {{ '}'|indent(indents - 2, True) }}{{ '\n' }} {%- endif -%} {%- endif -%} From 4fbbe5d8223bfa8bc4c8626488836b3442872951 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 22:12:47 -0400 Subject: [PATCH 23/33] Added the carryover entry. --- keepalived/templates/keepalived.jinja | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 52d8f53..329e5b6 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -23,8 +23,11 @@ {%- if data is mapping -%} {%- for entry in data|dictsort -%} {%- if entry[0] in groupings -%} -{{- config_entries(entry[1], indents + 2, carryover=entry[0]) -}} +{{- config_entries(entry[1], indents, carryover=entry[0]) -}} {%- else -%} + {%- if carryover -%} +{{ carryover|indent(indents, True) }} + {%- endif -%} {{ entry[0]|indent(indents, True) }} {{- config_entries(entry[1], indents + 2) -}} {%- endif -%} From 8e422ac369a6dbab5dd62d0b9638c95162d1a336 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 22:20:25 -0400 Subject: [PATCH 24/33] Added the missing space. --- keepalived/templates/keepalived.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 329e5b6..0d723a1 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -26,7 +26,7 @@ {{- config_entries(entry[1], indents, carryover=entry[0]) -}} {%- else -%} {%- if carryover -%} -{{ carryover|indent(indents, True) }} +{{ carryover|indent(indents, True) }}{{ ' ' }} {%- endif -%} {{ entry[0]|indent(indents, True) }} {{- config_entries(entry[1], indents + 2) -}} From b0c56cadabdd50bfb5ef28e69e3ebdab597003df Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 22:23:59 -0400 Subject: [PATCH 25/33] Added a missing space. --- keepalived/templates/keepalived.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 0d723a1..ebe4019 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -18,7 +18,7 @@ {{ data|string|indent(indents, True) }}{{ '\n' }} {%- else -%} {%- if indents != 0 and not carryover -%} -{{- "{\n" -}} +{{- " {\n" -}} {%- endif -%} {%- if data is mapping -%} {%- for entry in data|dictsort -%} From 5e4e5d8b4a2d811fa4e65f5e563e9522c1de5776 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 23:12:25 -0400 Subject: [PATCH 26/33] Added null string handler. --- keepalived/templates/keepalived.jinja | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index ebe4019..d752f04 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -29,7 +29,9 @@ {{ carryover|indent(indents, True) }}{{ ' ' }} {%- endif -%} {{ entry[0]|indent(indents, True) }} + {%- if entry[1] is defined -%} {{- config_entries(entry[1], indents + 2) -}} + {%- endif -%} {%- endif -%} {%- endfor -%} {%- else -%} From 50fdd24d421dbc5dec9a5a140641c4b4760ede84 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 23:16:13 -0400 Subject: [PATCH 27/33] Added null string handler. --- keepalived/templates/keepalived.jinja | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index d752f04..aa530fc 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -14,7 +14,7 @@ {%- set groupings = ['vrrp_script', 'vrrp_sync_group', 'vrrp_instance', 'virtual_server_group', 'virtual_server', 'real_server'] -%} {%- macro config_entries(data, indents, carryover='') -%} - {%- if data is string or data is number -%} + {%- if data is string or data is number or data is not defined -%} {{ data|string|indent(indents, True) }}{{ '\n' }} {%- else -%} {%- if indents != 0 and not carryover -%} @@ -29,9 +29,7 @@ {{ carryover|indent(indents, True) }}{{ ' ' }} {%- endif -%} {{ entry[0]|indent(indents, True) }} - {%- if entry[1] is defined -%} {{- config_entries(entry[1], indents + 2) -}} - {%- endif -%} {%- endif -%} {%- endfor -%} {%- else -%} From 914bad367c1da617810cbf0e87475fa834be4c7a Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 23:19:41 -0400 Subject: [PATCH 28/33] Added null string handler. --- keepalived/templates/keepalived.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index aa530fc..71267c5 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -14,7 +14,7 @@ {%- set groupings = ['vrrp_script', 'vrrp_sync_group', 'vrrp_instance', 'virtual_server_group', 'virtual_server', 'real_server'] -%} {%- macro config_entries(data, indents, carryover='') -%} - {%- if data is string or data is number or data is not defined -%} + {%- if data is string or data is number or data is none -%} {{ data|string|indent(indents, True) }}{{ '\n' }} {%- else -%} {%- if indents != 0 and not carryover -%} From 0541f8b4ce883f45daa67ecf8429c3e3b50d636b Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 23:25:07 -0400 Subject: [PATCH 29/33] Added null string handler. --- keepalived/templates/keepalived.jinja | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 71267c5..bfa6636 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -14,8 +14,10 @@ {%- set groupings = ['vrrp_script', 'vrrp_sync_group', 'vrrp_instance', 'virtual_server_group', 'virtual_server', 'real_server'] -%} {%- macro config_entries(data, indents, carryover='') -%} - {%- if data is string or data is number or data is none -%} + {%- if data is string or data is number -%} {{ data|string|indent(indents, True) }}{{ '\n' }} + {%- elif data is none -%} +{{ '\n' -}} {%- else -%} {%- if indents != 0 and not carryover -%} {{- " {\n" -}} From 3f4ab0c27a4dda27dee36bf146fc015c414332a1 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Mon, 24 Oct 2016 05:34:39 -0400 Subject: [PATCH 30/33] Clean up. --- keepalived/templates/keepalived.jinja | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index bfa6636..16196b3 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -15,32 +15,32 @@ 'virtual_server_group', 'virtual_server', 'real_server'] -%} {%- macro config_entries(data, indents, carryover='') -%} {%- if data is string or data is number -%} -{{ data|string|indent(indents, True) }}{{ '\n' }} + {{- data|string|indent(indents, True) }}{{ '\n' -}} {%- elif data is none -%} -{{ '\n' -}} + {{- '\n' -}} {%- else -%} {%- if indents != 0 and not carryover -%} -{{- " {\n" -}} + {{- " {\n" -}} {%- endif -%} {%- if data is mapping -%} {%- for entry in data|dictsort -%} {%- if entry[0] in groupings -%} -{{- config_entries(entry[1], indents, carryover=entry[0]) -}} + {{- config_entries(entry[1], indents, carryover=entry[0]) -}} {%- else -%} {%- if carryover -%} -{{ carryover|indent(indents, True) }}{{ ' ' }} + {{- carryover|indent(indents, True) }}{{ ' ' }} {%- endif -%} -{{ entry[0]|indent(indents, True) }} -{{- config_entries(entry[1], indents + 2) -}} + {{- entry[0]|indent(indents, True) }} + {{- config_entries(entry[1], indents + 2) -}} {%- endif -%} {%- endfor -%} {%- else -%} {%- for entry in data -%} -{{- config_entries(entry, indents) -}} + {{- config_entries(entry, indents) -}} {%- endfor -%} {%- endif -%} {%- if indents != 0 and not carryover -%} -{{ '}'|indent(indents - 2, True) }}{{ '\n' }} + {{- '}'|indent(indents - 2, True) }}{{ '\n' }} {%- endif -%} {%- endif -%} {%- endmacro -%} From 8d39c8f99ba1d60514f350cbebd976eec82d1d90 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Mon, 7 Nov 2016 22:42:47 -0500 Subject: [PATCH 31/33] Updated the pillar example. --- pillar.example | 150 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 118 insertions(+), 32 deletions(-) diff --git a/pillar.example b/pillar.example index 2044fd6..99b8db7 100644 --- a/pillar.example +++ b/pillar.example @@ -2,40 +2,126 @@ # Example pillar configuration # +# The following would generate the example file in RedHat based systems. + keepalived: global_defs: - notification_emails: - - alerts@example.com - smtp_server: 'mymail.example.com' + notification_email: + - acassen@firewall.loc + - failover@firewall.loc + - sysadmin@firewall.loc + notification_email_from: Alexandre.Cassen@firewall.loc + smtp_server: 192.168.200.1 smtp_connect_timeout: 30 - - vrrp_scripts: - chk_haproxy: - script: "killall -0 haproxy" - interval: 2 - + router_id: LVS_DEVEL vrrp_instances: - testhaproxy: - interface: eth0 - priority: 10 - virtual_router_id: 01 - smtp_alert: True - authentication: - auth_type: PASS - auth_pass: topsecret - virtual_ipaddresses: - - "10.20.30.40" - - "10.20.30.41" - - "10.20.30.42" - track_scripts: - - chk_haproxy - -# -# Example Addition Pillar for Master -# - -keepalived: - vrrp_instances: - testhaproxy: + VI_1: state: MASTER - priority: 101 + interface: eth0 + virtual_router_id: 51 + priority: 100 + advert_int: 1 + authentication: + auth_type: PASS + auth_pass: 1111 + virtual_ipaddress: + - 192.168.200.16 + - 192.168.200.17 + - 192.168.200.18 + virtual_server: + # Virtual and real servers include the port as part of the ID. + 192.168.200.100 443: + delay_loop: 6 + lb_algo: rr + lb_kind: NAT + nat_mask: 255.255.255.0 + persistence_timeout: 50 + protocol: TCP + real_server: + 192.168.201.100 443: + weight: 1 + SSL_GET: + # Must be a list because of multiple URL entries. + - url: + path: / + digest: ff20ad2481f97b1754ef3e12ecd3a9cc + - url: + path: /mrtg/ + digest: 9b3a0c85a887a256d6939da88aabd8cd + - connect_timeout: 3 + - nb_get_retry: 3 + - delay_before_retry: 3 + 10.10.10.2 1358: + delay_loop: 6 + lb_algo: rr + lb_kind: NAT + persistence_timeout: 50 + protocol: TCP + sorry_server: 192.168.200.200 1358 + real_server: + 192.168.200.2 1358: + weight: 1 + HTTP_GET: + # Must be a list because of multiple URL entries. + - url: + path: /testurl/test.jsp + digest: 640205b7b0fc66c1ea91c463fac6334d + - url: + path: /testurl2/test.jsp + digest: 640205b7b0fc66c1ea91c463fac6334d + - url: + path: /testurl3/test.jsp + digest: 640205b7b0fc66c1ea91c463fac6334d + - connect_timeout: 3 + - nb_get_retry: 3 + - delay_before_retry: 3 + 192.168.200.3 1358: + weight: 1 + HTTP_GET: + - url: + path: /testurl/test.jsp + digest: 640205b7b0fc66c1ea91c463fac6334c + - url: + path: /testurl2/test.jsp + digest: 640205b7b0fc66c1ea91c463fac6334c + - connect_timeout: 3 + - nb_get_retry: 3 + - delay_before_retry: 3 + 10.10.10.3 1358: + delay_loop: 3 + lb_algo: rr + lb_kind: NAT + nat_mask: 255.255.255.0 + persistence_timeout: 50 + protocol: TCP + real_server: + 192.168.200.4 1358: + weight: 1 + HTTP_GET: + - url: + path: /testurl/test.jsp + digest: 640205b7b0fc66c1ea91c463fac6334d + - url: + path: /testurl2/test.jsp + digest: 640205b7b0fc66c1ea91c463fac6334d + - url: + path: /testurl3/test.jsp + digest: 640205b7b0fc66c1ea91c463fac6334d + - connect_timeout: 3 + - nb_get_retry: 3 + - delay_before_retry: 3 + 192.168.200.5 1358: + weight: 1 + HTTP_GET: + - url: + path: /testurl/test.jsp + digest: 640205b7b0fc66c1ea91c463fac6334d + - url: + path: /testurl2/test.jsp + digest: 640205b7b0fc66c1ea91c463fac6334d + - url: + path: /testurl3/test.jsp + digest: 640205b7b0fc66c1ea91c463fac6334d + - connect_timeout: 3 + - nb_get_retry: 3 + - delay_before_retry: 3 From b5342f3813257432d71df3473b73fdad1b0e7298 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Tue, 8 Nov 2016 13:48:11 -0500 Subject: [PATCH 32/33] Added a macro explanation. --- keepalived/templates/keepalived.jinja | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 16196b3..67cecee 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -5,6 +5,21 @@ # This file is managed by Salt. # Any changes will be overwritten. {{ '\n' }} + +{# +Macro Explanation: + +This is a recursive macro that takes the type of entry and determines how +it is suppose to appear in the configuration file. Strings and numbers +are just written out. Lists and hashes are placed inside if couple of +parenthesis. It also takes into account the special groupings like +vrrp_instance and virtual_server. Any additional data from a list or a +hash is then processed by calling the macro again. + +Forced carriage returns and use of jinja’s indent are only there to make +the final file more human readable. They serve no other function. +#} + {%- import_yaml 'keepalived/defaults.yaml' as keepalived_defaults -%} {%- set keepalived_final_values = salt.pillar.get( 'keepalived', From ebdd62d5e851b46b88ee92578d50dfa5d0822b50 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Tue, 8 Nov 2016 15:30:55 -0500 Subject: [PATCH 33/33] Corrected readme. --- README.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 3128ebe..18c428a 100644 --- a/README.rst +++ b/README.rst @@ -30,10 +30,7 @@ Install ``keepalived`` from packages. ``keepalived.config`` ------------------ -Slowly adding configuration options per the documents, not everything is available - -To Do: - - LVS configuration section +Configuration options for ``keepalived``. ``keepalived.service`` -------------------