Merge branch 'master' of ssh://source.hawkless.id.au:222/coryHawkvelt/ansible-network-config into HEAD

This commit is contained in:
Cory Hawkvelt 2024-10-11 01:00:51 +10:30
commit 454f0d4655
No known key found for this signature in database
2 changed files with 33 additions and 14 deletions

View File

@ -21,24 +21,39 @@
state: absent
tags: interfaces
- name: Remove /etc/netplan/01-netcfg.yaml
file:
path: /etc/netplan/01-netcfg.yaml
state: absent
# - name: Get directory stats
# stat:
# path: "/etc/netplan"
# register: directory_stat
# - name: Delete directory
# file:
# path: "/etc/netplan"
# state: absent
# - name: Create directory
# file:
# path: "/etc/netplan"
# state: directory
# owner: "{{ directory_stat.stat.pw_name }}"
# group: "{{ directory_stat.stat.gr_name }}"
# mode: "{{ directory_stat.stat.mode }}"
- name: 'Collect files in netplan dir'
find:
paths: "/etc/netplan/"
hidden: True
recurse: True
# file_type: any # Added in ansible 2.3
register: collected_files
tags: interfaces
- name: Remove /etc/netplan/50-cloud-init.yaml
- name: Remove collected files
file:
path: /etc/netplan/50-cloud-init.yaml
path: "{{ item.path }}"
state: absent
with_items: "{{ collected_files.files }}"
tags: interfaces
- name: Remove /etc/netplan/00-installer-config.yaml
file:
path: /etc/netplan/00-installer-config.yaml
state: absent
tags: interfaces
- name: Add the bonding module
modprobe:
name: bonding

View File

@ -95,7 +95,11 @@ auto {{ item['name'] }}
{% if item['mtu'] is defined %}
mtu {{ item['mtu'] }}
{% endif %}
bond-mode active-backup
{% if item['bond-mode'] is defined %}
bond-mode {{ item['bond-mode'] }}
{% else %}
bond-mode active-backup
{% endif %}
bond-miimon 100
bond-slaves none
{% if item['routes'] is defined %}