Add common roles from polyfloyd's playbookds
This commit is contained in:
parent
1332f49101
commit
e43ec3229f
23 changed files with 694 additions and 0 deletions
42
roles/common/tasks/network.yaml
Normal file
42
roles/common/tasks/network.yaml
Normal file
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
- name: Install bridge-utils
|
||||
apt:
|
||||
name: bridge-utils
|
||||
state: present
|
||||
when: network_br
|
||||
|
||||
- lineinfile:
|
||||
path: /etc/sysctl.conf
|
||||
regexp: ^#?net.ipv4.ip_forward
|
||||
line: "net.ipv4.ip_forward=1 # Managed by Ansible"
|
||||
notify: reboot
|
||||
when: network_br
|
||||
|
||||
- lineinfile:
|
||||
path: /etc/sysctl.conf
|
||||
regexp: ^#?net.ipv6.conf.all.forwarding
|
||||
line: "net.ipv6.conf.all.forwarding=1 # Managed by Ansible"
|
||||
notify: reboot
|
||||
when: network_br
|
||||
|
||||
- name: Make network interfaces really predictable
|
||||
lineinfile:
|
||||
path: /etc/default/grub
|
||||
regexp: ^GRUB_CMDLINE_LINUX
|
||||
line: 'GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0" # Managed by Ansible'
|
||||
notify:
|
||||
- update grub
|
||||
- reboot
|
||||
when: network_br or network_dhcp or network_static
|
||||
|
||||
- name: Configure network interfaces
|
||||
template:
|
||||
src: network-interfaces
|
||||
dest: /etc/network/interfaces
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify: reboot
|
||||
when: network_br or network_dhcp or network_static
|
||||
|
||||
- meta: flush_handlers
|
Loading…
Add table
Add a link
Reference in a new issue