Skip to content
Snippets Groups Projects
Commit 0d874a34 authored by Zdeněk Vydra's avatar Zdeněk Vydra
Browse files

OPNsense use static networking for all interfaces

parent 6ddb1541
No related branches found
No related tags found
No related merge requests found
......@@ -10,14 +10,6 @@
loop: '{{ kypo_interface_interfaces }}'
when: kypo_interface_clean is defined and kypo_interface_clean
- name: configure interfaces
include_tasks: interface-FreeBSD.yml
vars:
kypo_interface_device: '{{ kypo_interface_item.kypo_interface_device }}'
loop_control:
loop_var: kypo_interface_item
loop: '{{ kypo_interface_interfaces }}'
- name: get default gateway
set_fact:
kypo_interface_default_gateway: '{{ kypo_interface_interfaces | selectattr("kypo_interface_default_gateway", "defined") | first }}'
......@@ -68,7 +60,7 @@
delegate_to: localhost
- set_fact:
interfaces: "{{ ansible_interfaces | select('match', '^(vtnet)[2-9]+') | list }}"
interfaces: "{{ ansible_interfaces | select('match', '^(vtnet)[0-9]+') | list }}"
- set_fact:
interface_configs: |-
......@@ -78,7 +70,7 @@
{%- endfor -%}
]
- name: set static addressing on user defined networks
- name: set static addressing on allnetworks
xml:
path: '{{ kypo_interface_opnsense_local_config_file }}'
xpath: '/opnsense/interfaces/{{ item.0.if }}/{{ item.1.key }}'
......
- name: prepare interface configuration
set_fact:
kypo_interface_config:
if: '{{ kypo_interface_device }}'
ipaddr: dhcp
mtu: '{{ kypo_interface_mtu }}'
enable: 1
- name: configure interface
xml:
path: '{{ kypo_interface_opnsense_local_config_file }}'
xpath: '/opnsense/interfaces/{{ kypo_interface_device }}/{{ item.key }}'
value: '{{ item.value }}'
pretty_print: yes
delegate_to: localhost
loop: '{{ kypo_interface_config | dict2items }}'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment