Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kypo-interface
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MUNI-KYPO-CRP
backend-python
ansible-networking-stage
kypo-interface
Commits
e3e4cd17
Verified
Commit
e3e4cd17
authored
2 years ago
by
Tomáš Sapák
Browse files
Options
Downloads
Patches
Plain Diff
Set static addressing on user defined networks to workaround routing issues
parent
4167766c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tasks/FreeBSD.yml
+25
-0
25 additions, 0 deletions
tasks/FreeBSD.yml
with
25 additions
and
0 deletions
tasks/FreeBSD.yml
+
25
−
0
View file @
e3e4cd17
...
...
@@ -62,6 +62,31 @@
loop
:
'
{{
firewall_rule
|
dict2items
}}'
delegate_to
:
localhost
-
name
:
install netaddr on controller
pip
:
name
:
netaddr
delegate_to
:
localhost
-
set_fact
:
interfaces
:
"
{{
ansible_interfaces
|
select('match',
'^(vtnet)[2-9]+')
|
list
}}"
-
set_fact
:
interface_configs
:
|-
[
{%- for interface in interfaces -%}
{ if: {{ interface }}, settings: [{key: if, value: {{ interface }}},{key: ipaddr,value: {{ ansible_facts[interface]['ipv4'][0]['address'] }}},{key: subnet,value: {{ ('127.0.0.1/' ~ ansible_facts[interface]['ipv4'][0]['netmask']) | ipaddr('prefix') }}},{key: mtu,value: 1442},{key: enable,value: 1}]},
{%- endfor -%}
]
-
name
:
set static addressing on user defined networks
xml
:
path
:
'
{{
kypo_interface_opnsense_local_config_file
}}'
xpath
:
'
/opnsense/interfaces/{{
item.0.if
}}/{{
item.1.key
}}'
value
:
'
{{
item.1.value
}}'
pretty_print
:
yes
loop
:
"
{{
interface_configs
|
from_yaml
|
subelements('settings')
}}"
delegate_to
:
localhost
-
name
:
copy the modified configuration to machine
copy
:
src
:
'
{{
kypo_interface_opnsense_local_config_file
}}'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment