Support for multiple ips for single interface
diff --git a/README.rst b/README.rst
index 81b77ba..639d612 100644
--- a/README.rst
+++ b/README.rst
@@ -8,25 +8,43 @@
Sample pillar
=============
+Simple virtual IP on an interface
+
.. code-block:: yaml
keepalived:
cluster:
enabled: True
instance:
- VI_1:
+ VIP1:
priority: 100 (highest priority must be on primary server, different for cluster members)
virtual_router_id: 51
password: pass
address: 192.168.10.1
interface: eth0
- VI_2:
+ VIP2:
priority: 150 (highest priority must be on primary server, different for cluster members)
virtual_router_id: 52
password: pass
address: 10.0.0.5
interface: eth1
-
+
+Multiple virtual IPs on single interface
+
+.. code-block:: yaml
+
+ keepalived:
+ cluster:
+ enabled: True
+ instance:
+ VIP1:
+ priority: 100 (highest priority must be on primary server, different for cluster members)
+ virtual_router_id: 51
+ password: pass
+ addresses:
+ - 192.168.10.1
+ - 192.168.10.2
+ interface: eth0
Read more
=========
diff --git a/keepalived/files/keepalived.conf b/keepalived/files/keepalived.conf
index 63d46bf..30c8d47 100644
--- a/keepalived/files/keepalived.conf
+++ b/keepalived/files/keepalived.conf
@@ -18,7 +18,13 @@
auth_pass {{ instance.password }}
}
virtual_ipaddress {
+ {%- if instance.addresses is defined %}
+ {%- for address in instance.addresses %}
+ {{ address }}
+ {%- endfor %}
+ {%- else %}
{{ instance.address }}
+ {%- endif %}
}
}
{% endfor %}
\ No newline at end of file