Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kypo-ansible-stage-one
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-ansible-stage-one
Commits
494cb684
Commit
494cb684
authored
3 years ago
by
Zdeněk Vydra
Committed by
Michal Urban
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Implement opnsense support
parent
c14f4883
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
provisioning/playbook.yml
+16
-6
16 additions, 6 deletions
provisioning/playbook.yml
provisioning/roles/kypo-interface
+1
-1
1 addition, 1 deletion
provisioning/roles/kypo-interface
with
17 additions
and
7 deletions
provisioning/playbook.yml
+
16
−
6
View file @
494cb684
...
@@ -147,19 +147,21 @@
...
@@ -147,19 +147,21 @@
{%-
set
variables.interfaces
=
variables.interfaces
+
[{
{%-
set
variables.interfaces
=
variables.interfaces
+
[{
"kypo_interface_default_gateway":
interface.def_gw_ip,
"kypo_interface_default_gateway":
interface.def_gw_ip,
"kypo_interface_mac":
interface.mac,
"kypo_interface_mac":
interface.mac,
"kypo_interface_routes":
variables.routes
"kypo_interface_routes":
variables.routes,
"kypo_interface_device":
network.mac_to_interface(interface.mac)
}]
-%}
}]
-%}
{%-
endfor
-%}
{%-
endfor
-%}
{%-
endif
-%}
{%-
endif
-%}
{%-
set
inventory_mac_addresses
=
interfaces
|
map(attribute="mac")
|
list
-%}
{%-
set
inventory_mac_addresses
=
interfaces
|
map(attribute="mac")
|
list
-%}
{%-
set
the_rest_
mac_address
es
=
network.kypo_common_network.interfaces
|
{%-
set
the_rest_
interfac
es
=
network.kypo_common_network.interfaces
|
selectattr("macaddress",
"defined")
|
selectattr("macaddress",
"defined")
|
rejectattr("macaddress",
"in",
inventory_mac_addresses)
|
rejectattr("macaddress",
"in",
inventory_mac_addresses)
|
map(attribute="macaddress
")
|
list
selectattr("type",
"eq",
"ether
")
|
list
-%}
-%}
{%-
for
mac_address
in
the_rest_
mac_address
es
-%}
{%-
for
interface
in
the_rest_
interfac
es
-%}
{%-
set
variables.interfaces
=
variables.interfaces
+
[{
{%-
set
variables.interfaces
=
variables.interfaces
+
[{
"kypo_interface_mac":
mac_address,
"kypo_interface_mac":
interface.macaddress,
"kypo_interface_device":
interface.device
}]
-%}
}]
-%}
{%-
endfor
-%}
{%-
endfor
-%}
{{
variables.interfaces
}}'
{{
variables.interfaces
}}'
...
@@ -181,7 +183,7 @@
...
@@ -181,7 +183,7 @@
become_user
:
root
become_user
:
root
tasks
:
tasks
:
-
command
:
'
ping
{{
hostvars["man"]["default_gateway_interface_ip"]
}}
-c
3
'
-
command
:
'
ping
-c
3
{{
hostvars["man"]["default_gateway_interface_ip"]
}}'
changed_when
:
False
changed_when
:
False
-
name
:
User access on MAN and UAN
-
name
:
User access on MAN and UAN
...
@@ -320,6 +322,14 @@
...
@@ -320,6 +322,14 @@
path
:
/etc/cloud/cloud.cfg
path
:
/etc/cloud/cloud.cfg
regexp
:
'
^manage_etc_hosts'
regexp
:
'
^manage_etc_hosts'
line
:
'
manage_etc_hosts:
localhost'
line
:
'
manage_etc_hosts:
localhost'
when
:
ansible_facts['os_family'] != 'FreeBSD'
-
name
:
Make cloud-init to preserve changes
lineinfile
:
path
:
/usr/local/etc/cloud/cloud.cfg
regexp
:
'
^manage_etc_hosts'
line
:
'
manage_etc_hosts:
localhost'
when
:
ansible_facts['os_family'] == 'FreeBSD'
-
name
:
remove stack name prefix from /etc/hosts file
-
name
:
remove stack name prefix from /etc/hosts file
replace
:
replace
:
...
...
This diff is collapsed.
Click to expand it.
kypo-interface
@
4167766c
Compare
2b94a7b0
...
4167766c
Subproject commit
2b94a7b07286d7913d83bf66232825092bba1629
Subproject commit
4167766c89f3ea76ddc1b0fc615eda7290fed1f5
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