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
e2224bc4
Commit
e2224bc4
authored
6 years ago
by
Kamil Andoniadis
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "Prepare role for using with Ansible Galaxy"
parent
097526c8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+10
-10
10 additions, 10 deletions
README.md
defaults/main.yml
+6
-1
6 additions, 1 deletion
defaults/main.yml
meta/main.yml
+19
-0
19 additions, 0 deletions
meta/main.yml
tasks/main-interface.yml
+1
-1
1 addition, 1 deletion
tasks/main-interface.yml
with
36 additions
and
12 deletions
README.md
+
10
−
10
View file @
e2224bc4
# Ansible role - Interface
- BETA
(only for Ansible 2.3.3.0)
# Ansible role - Interface (only for Ansible 2.3.3.0)
This role serves for network interface configuration on debian-based systems.
...
...
@@ -19,22 +19,22 @@ This role serves for network interface configuration on debian-based systems.
Mandatory parameters.
*
`interface_interfaces`
- The list of network interface parameters. Each interface may consists of following attributes.
*
`interface_mac`
(mandatory) - .
*
`interface_default_gateway`
(optional) - .
*
`interface_mac`
(mandatory) -
The MAC address of interface to configure
.
*
`interface_default_gateway`
(optional) -
The IPv4 address of default gateway
.
*
`interface_routes`
(optional) - The list of route parameters. Each route must consist of following attributes.
*
`gateway`
(mandatory) - .
*
`network`
(mandatory) - .
*
`mask`
(mandatory) - .
*
`gateway`
(mandatory) -
The IPv4 address of default gateway for this route
.
*
`network`
(mandatory) -
The IP address of network from which pakets will be routed
.
*
`mask`
(mandatory) -
The subnet mask in address format or prefix number
.
Optional parameters.
*
`interface_clean`
- .
*
`interface_mtu`
- .
*
`interface_file_name`
- .
*
`interface_clean`
-
Boolean value (
**True**
/
**False**
) that means whether to clean all interface configuration before applying role or not
.
*
`interface_mtu`
-
The number of maximum transmission unit
.
*
`interface_file_name`
-
The file name for your configuration located in
`/etc/network/interfaces.d/`
directory
.
## Example
Example of the simplest network interface configuration that
Example of the simplest network interface configuration that
just set MTU of specified interface.
```
yml
roles
:
...
...
This diff is collapsed.
Click to expand it.
defaults/main.yml
+
6
−
1
View file @
e2224bc4
...
...
@@ -2,7 +2,12 @@
interface_default_file
:
/etc/network/interfaces
interface_directory
:
'
{{
interface_default_file
}}.d'
interface_file_name
:
interface_file
:
'
{%
if
interface_file_name
is
defined
and
interface_file_name
%}{{
interface_directory
}}/{{
interface_file_name
}}{%
else
%}{{
interface_default_file
}}{%
endif
%}'
interface_file
:
'
{%-
if
interface_file_name
is
defined
and
interface_file_name
-%}
{{
interface_directory
}}/{{
interface_file_name
}}
{%-
else
-%}
{{
interface_default_file
}}
{%-
endif
%}'
interface_clean
:
True
interface_mtu
:
1442
...
...
This diff is collapsed.
Click to expand it.
meta/main.yml
0 → 100644
+
19
−
0
View file @
e2224bc4
dependencies
:
-
src
:
git@gitlab.ics.muni.cz:CSIRT-MU-public/ansible-roles/common.git
scm
:
git
galaxy_info
:
role_name
:
interface
author
:
Kamil Andoniadis
description
:
Basic network interface configuration
licence
:
MIT
min_ansible_version
:
2.3.3
platforms
:
-
name
:
Debian
versions
:
-
all
-
name
:
Ubuntu
versions
:
-
all
This diff is collapsed.
Click to expand it.
tasks/main-interface.yml
+
1
−
1
View file @
e2224bc4
...
...
@@ -5,7 +5,7 @@
when
:
not interface_mac
-
set_fact
:
interface_device
:
'
{%-
from
"templates/network.j2"
import
mac_to_interface
with
context
-%}
interface_device
:
'
{%-
from
"
roles/common/
templates/network.j2"
import
mac_to_interface
with
context
-%}
{{
mac_to_interface(interface_mac)
|
default("")
}}'
-
include
:
clean.yml
...
...
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