ansible-network-config/tasks/main.yml

59 lines
1.3 KiB
YAML
Raw Normal View History

2020-07-30 07:34:46 +00:00
- name: Install required system packages
2020-11-02 06:45:11 +00:00
apt: name={{ item }} state=present update_cache=yes
2020-07-30 07:34:46 +00:00
loop: [
'ifupdown',
'ifenslave',
]
tags: interfaces
- name: Configure /etc/network/interfaces
template:
src: templates/interfaces.j2
dest: /etc/network/interfaces
backup: yes
tags: interfaces
- name: Remove /etc/network/interfaces.d/eth0
file:
path: /etc/network/interfaces.d/eth0
state: absent
tags: interfaces
- name: Remove /etc/netplan/01-netcfg.yaml
file:
path: /etc/netplan/01-netcfg.yaml
state: absent
tags: interfaces
- name: Remove /etc/netplan/50-cloud-init.yaml
file:
path: /etc/netplan/50-cloud-init.yaml
state: absent
tags: interfaces
- name: Add the bonding module
modprobe:
name: bonding
state: present
tags: interfaces
- name: Add the 8021q module
modprobe:
name: 8021q
state: present
tags: interfaces
- name: Make sure 8021q\dot1q makes it into /etc/modules for loading at boot time
lineinfile:
path: /etc/modules
state: present
line: '8021q'
tags: interfaces
- name: Make sure bonding makes it into /etc/modules for loading at boot time
lineinfile:
path: /etc/modules
state: present
line: 'bonding'
tags: interfaces