exit: add DHCP relay for new server
Really quite shoddy as it is right now. Should get better once the old server is retired.
This commit is contained in:
parent
bb41d406f8
commit
99aef43574
5 changed files with 27 additions and 43 deletions
|
@ -1,16 +1,17 @@
|
|||
# TODO rewrite task and templates into something sane once the old DHCP server is retired
|
||||
- set_fact:
|
||||
dhcp_servers: '{{ prefixes | selectattr("custom_fields.dhcp_server") | groupby(attribute="custom_fields.dhcp_server.address") }}'
|
||||
|
||||
- name: Install keepalived
|
||||
import_tasks: keepalived.yml
|
||||
|
||||
- name: Create keepalive notify script for systemd services
|
||||
copy:
|
||||
dest: /usr/local/bin/
|
||||
src: keepalive-service
|
||||
mode: 0755
|
||||
|
||||
- name: Configure DHCP relays
|
||||
- name: Configure relay for old DHCP server
|
||||
template:
|
||||
dest: "/etc/default/isc-dhcp-relay"
|
||||
dest: '/etc/default/isc-dhcp-relay-{{ prefixes | selectattr("prefix", "==", item.0 | ipaddr("network/prefix")) | map(attribute="vrf.name") | first }}'
|
||||
src: isc-dhcp-relay.j2
|
||||
loop: '{{ dhcp_servers }}'
|
||||
loop_control:
|
||||
label: "{{ item.0 }}"
|
||||
notify: restart keepalived
|
||||
|
||||
- name: Set up keepalived
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue