Skip to content

Commit 9e255f8

Browse files
authored
Merge pull request #19 from Oefenweb/pr-18
Add Support for Bonded Interfaces + Add Missing Pre/Post Hooks
2 parents a4e838d + 53ddda9 commit 9e255f8

File tree

12 files changed

+85
-74
lines changed

12 files changed

+85
-74
lines changed

.ansible-lint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ warn_list:
33
- role-name
44
- name[casing]
55
- no-handler
6+
- jinja[spacing]

.github/workflows/ci.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Check out the codebase
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v3
1919

2020
- name: Set up Python 3
21-
uses: actions/setup-python@v2
21+
uses: actions/setup-python@v4
2222
with:
2323
python-version: '3.x'
2424

2525
- name: Install test dependencies
26-
run: pip install ansible-lint[community,yamllint]
26+
run: |
27+
pip install ansible-lint
28+
ansible-galaxy install -r requirements.yml
2729
2830
- name: Lint code
2931
run: |
@@ -43,22 +45,19 @@ jobs:
4345
matrix:
4446
include:
4547
- distro: debian8
46-
ansible-version: '<2.10'
4748
- distro: debian9
48-
- distro: ubuntu1604
49-
ansible-version: '>=2.9, <2.10'
5049
- distro: ubuntu1604
5150
ansible-version: '>=2.10, <2.11'
5251
- distro: ubuntu1604
5352

5453
steps:
5554
- name: Check out the codebase
56-
uses: actions/checkout@v2
55+
uses: actions/checkout@v3
5756
with:
5857
path: "${{ github.repository }}"
5958

6059
- name: Set up Python 3
61-
uses: actions/setup-python@v2
60+
uses: actions/setup-python@v4
6261
with:
6362
python-version: '3.x'
6463

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Check out the codebase
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
1616

1717
- name: Publish to Galaxy
1818
uses: robertdebock/galaxy-action@1.2.0

Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
FROM ubuntu:16.04
1+
FROM ubuntu:18.04
22
MAINTAINER Mischa ter Smitten <mtersmitten@oefenweb.nl>
33

4+
ENV LANG C.UTF-8
5+
ENV LC_ALL C.UTF-8
6+
47
# python
58
RUN apt-get update && \
6-
DEBIAN_FRONTEND=noninteractive apt-get install -y python-minimal python-dev curl && \
9+
DEBIAN_FRONTEND=noninteractive apt-get install -y python3-minimal python3-dev curl && \
710
apt-get clean
8-
RUN curl -sL https://bootstrap.pypa.io/pip/2.7/get-pip.py | python -
11+
RUN curl -sL https://bootstrap.pypa.io/pip/3.6/get-pip.py | python3 -
912
RUN rm -rf $HOME/.cache
1013

1114
# ansible
12-
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y gcc libffi-dev libssl-dev && \
15+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python3-apt && \
1316
apt-get clean
14-
RUN pip install ansible==2.9.15
17+
RUN pip3 install ansible==2.10.7
1518
RUN rm -rf $HOME/.cache
1619

1720
# provision

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,25 @@ None
4040
* `network_interfaces_interfaces.{n}.bridge.maxwait`: [optional]: Maximum time to wait for the bridge ports to get to the forwarding status
4141
* `network_interfaces_interfaces.{n}.bridge.waitport`: [optional]: Maximum time to wait for the specified ports to become available
4242

43+
##### Bond
44+
45+
* `network_interfaces_interfaces.{n}.bond`: [optional, default: `{}`]: Bond declarations
46+
* `network_interfaces_interfaces.{n}.bond.mode`: [optional]: Bonding mode. One of "active-backup", "balance-slb", or "balance-tcp"
47+
* `network_interfaces_interfaces.{n}.bond.miimon`: [optional]: Specifies the MII link monitoring frequency in milliseconds
48+
* `network_interfaces_interfaces.{n}.bond.master`: [optional]: The name of the device that should act as bond master
49+
* `network_interfaces_interfaces.{n}.bond.slaves`: [optional]: A list of devices to be used as bond slave
50+
* `network_interfaces_interfaces.{n}.bond.lacp-rate`: [optional]: Option specifying the rate in of transmission of LACPDU packets in 802.3ad mode
51+
* `network_interfaces_interfaces.{n}.bond.xmit-hash-policy`: [optional]: The transmit hash policy to use for slave selection in balance-xor and 802.3ad modes
52+
4353
##### Inline hook scripts
4454

4555
* `network_interfaces_interfaces.{n}.pre-up`: [optional, default: `[]`]: List of pre-up script lines
4656
* `network_interfaces_interfaces.{n}.up`: [optional, default: `[]`]: List of up script lines
57+
* `network_interfaces_interfaces.{n}.post-up`: [optional, default: `[]`]: List of post-up script lines
58+
* `network_interfaces_interfaces.{n}.pre-down`: [optional, default: `[]`]: List of pre-down script lines
4759
* `network_interfaces_interfaces.{n}.down`: [optional, default: `[]`]: List of down script lines
4860
* `network_interfaces_interfaces.{n}.post-down`: [optional, default: `[]`]: List of post-down script lines
4961

50-
5162
## Dependencies
5263

5364
None

Vagrantfile

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,6 @@ boxes = [
1111
:cpu => "50",
1212
:ram => "256"
1313
},
14-
{
15-
:name => "ubuntu-1804",
16-
:box => "bento/ubuntu-18.04",
17-
:ip => '10.0.0.13',
18-
:cpu => "50",
19-
:ram => "384"
20-
},
21-
{
22-
:name => "ubuntu-2004",
23-
:box => "bento/ubuntu-20.04",
24-
:ip => '10.0.0.14',
25-
:cpu => "50",
26-
:ram => "384"
27-
},
2814
{
2915
:name => "debian-8",
3016
:box => "bento/debian-8",
@@ -39,13 +25,6 @@ boxes = [
3925
:cpu => "50",
4026
:ram => "256"
4127
},
42-
{
43-
:name => "debian-10",
44-
:box => "bento/debian-10",
45-
:ip => '10.0.0.18',
46-
:cpu => "50",
47-
:ram => "256"
48-
},
4928
]
5029

5130
Vagrant.configure("2") do |config|

handlers/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# handlers file
22
---
33
- name: restart network-interfaces
4-
service:
4+
ansible.builtin.service:
55
name: "{{ network_interfaces_service }}"
66
state: restarted

meta/main.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# meta file
22
---
33
galaxy_info:
4-
namespace: oefenweb
4+
author: oefenweb
55
role_name: network_interfaces
6-
author: Andreas Reischuck
7-
company: Dresden Weekly
6+
company: Oefenweb.nl B.V.
87
description: Manage network interfaces in Debian-like systems
98
license: MIT
10-
min_ansible_version: 2.9.0
9+
min_ansible_version: 2.10.0
1110
platforms:
1211
- name: Ubuntu
1312
versions:

molecule/default/collections.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
collections:
3+
- name: community.docker
4+
version: '>=1.2.0,<2'
5+
- name: community.general
6+
version: '>=2,<3'

requirements.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# requirements file
2+
---
3+
collections: []

0 commit comments

Comments
 (0)