This commit is contained in:
Guy Godfroy 2020-07-20 16:05:30 +02:00
parent 5c06670ed7
commit 17b9117efd
3 changed files with 20 additions and 1 deletions

View File

@ -1,2 +1,3 @@
---
# handlers file for openbsd-carp
- name: start carp{{ carp.num }}
command: "sh /etc/netstart carp{{ carp.num }}"

View File

@ -9,3 +9,14 @@
name: net.inet.carp.preempt
value: '1'
when: openbsd_carp_preempt
- name: Configure carp{{ carp.num }}
template:
src: hostname.carp.j2
dest: /etc/hostname.carp{{ carp.num }}
notify: start carp{{ carp.num }}
loop: "{{ openbsd_carp | flatten(level=1) }}"
loop_control:
loop_var: carp
- meta: flush_handlers

View File

@ -0,0 +1,7 @@
inet {{ carp.ip | ipaddr('address') }} {{ carp.ip | ipaddr('netmask') }} {{ carp.ip | ipaddr('broadcast') }}
vhid {{ carp.vhid }}
carpdev {{ carp.interface }}
pass "{{ carp.password }}"
{% if carp.description is defined %}
description "{{ carp.description }}"
{% endif %}