Adding additional vrrp
This commit is contained in:
parent
671f64b672
commit
f419f265e9
@ -1,6 +1,6 @@
|
|||||||
{%- set key = 0 -%}
|
{%- set key = 0 -%}
|
||||||
{%- set value = 1 -%}
|
{%- set value = 1 -%}
|
||||||
{%- set carryovers = ['vrrp_script'] -%}
|
{%- set carryovers = ['vrrp_instance', 'vrrp_script'] -%}
|
||||||
{%- macro keepalived_config(data, carryover='', recurse=-1) -%}
|
{%- macro keepalived_config(data, carryover='', recurse=-1) -%}
|
||||||
{%- set recurse = recurse + 1 -%}
|
{%- set recurse = recurse + 1 -%}
|
||||||
{%- if data is none -%}
|
{%- if data is none -%}
|
||||||
|
@ -64,5 +64,20 @@ class TestKeepalivedConfiguration(unittest.TestCase):
|
|||||||
result = 'vrrp_script gizmo {\nbarney rubble\nfred flintstone\n}\n'
|
result = 'vrrp_script gizmo {\nbarney rubble\nfred flintstone\n}\n'
|
||||||
self.renderTest(testdata, result)
|
self.renderTest(testdata, result)
|
||||||
|
|
||||||
|
def test_carryover_contains_arry(self):
|
||||||
|
testdata = {'vrrp_script': {'gizmo': [{'fred': 'flintstone'}, {'barney': 'rubble'}]}}
|
||||||
|
result = 'vrrp_script gizmo {\nfred flintstone\nbarney rubble\n}\n'
|
||||||
|
self.renderTest(testdata, result)
|
||||||
|
|
||||||
|
def test_carrover_vrrp_instance(self):
|
||||||
|
testdata = {'vrrp_instance': {'gizmo': {'fred': 'flintstone', 'barney': 'rubble'}}}
|
||||||
|
result = 'vrrp_instance gizmo {\nbarney rubble\nfred flintstone\n}\n'
|
||||||
|
self.renderTest(testdata, result)
|
||||||
|
|
||||||
|
def test_carryovers_in_an_array(self):
|
||||||
|
testdata = [{'vrrp_script': {'gizmo': {'running': 'dumdums'}}}, {'vrrp_instance': {'dumdums': {'fred': 'flintstone'}}}]
|
||||||
|
result = 'vrrp_script gizmo {\nrunning dumdums\n}\nvrrp_instance dumdums {\nfred flintstone\n}\n'
|
||||||
|
self.renderTest(testdata, result)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Loading…
Reference in New Issue
Block a user