41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
---
|
|
- name: Create ethernet interface configurations
|
|
ansible.builtin.template:
|
|
src: hostname.if.j2
|
|
dest: "/etc/hostname.{{ item.device }}"
|
|
mode: "0600"
|
|
owner: root
|
|
group: "{{ ansible_wheel }}"
|
|
with_items: "{{ network_interfaces }}"
|
|
notify: Restart network
|
|
|
|
- name: Create carp interface configurations
|
|
ansible.builtin.template:
|
|
src: hostname.carp.j2
|
|
dest: "/etc/hostname.carp{{ item.vhid }}"
|
|
mode: "0600"
|
|
owner: root
|
|
group: "{{ ansible_wheel }}"
|
|
with_items: "{{ network_vip_interfaces }}"
|
|
notify: Restart network
|
|
when:
|
|
- network_vip_interfaces is defined
|
|
- network_vip_interfaces != []
|
|
|
|
- name: Enable CARP preempt
|
|
ansible.posix.sysctl:
|
|
name: net.inet.carp.preempt
|
|
value: "1"
|
|
when:
|
|
- network_vip_interfaces is defined
|
|
- network_vip_interfaces != []
|
|
|
|
- name: Set default gateway
|
|
ansible.builtin.copy:
|
|
content: "{{ network_default_gateway }}\n"
|
|
dest: /etc/mygate
|
|
mode: "0600"
|
|
owner: root
|
|
group: "{{ ansible_wheel }}"
|
|
notify: Restart network
|
|
when: network_default_gateway is defined
|