mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-26 15:55:56 +02:00
Update to 2021-12-01 19:13
This commit is contained in:
27
roles/network/tasks/main.yml
Normal file
27
roles/network/tasks/main.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
|
||||
- name: Configure IPv4 Forwarding
|
||||
sysctl: name="net.ipv4.ip_forward" value={{ net_ipv4_forward | ternary('1', '0') }} sysctl_file=/etc/sysctl.d/network.conf sysctl_set=yes state=present reload=yes
|
||||
when: ansible_virtualization_type != 'systemd-nspawn'
|
||||
|
||||
- name: Deploy /etc/hosts
|
||||
template: src=hosts.j2 dest=/etc/hosts
|
||||
|
||||
- name: Prevent PVE from changing /etc/hosts
|
||||
copy: content='' dest=/etc/.pve-ignore.hosts
|
||||
when: ansible_virtualization_type == 'lxc'
|
||||
|
||||
- name: Merge interface settings with defaults
|
||||
set_fact: net_if_conf={{ net_if_conf | default([]) + [ net_if_defaults | combine(item, recursive=True) ] }}
|
||||
with_items: "{{ net_if }}"
|
||||
tags: net,conf
|
||||
- set_fact: net_if={{ net_if_conf | default([]) }}
|
||||
tags: net,conf
|
||||
|
||||
- name: Deploy interface configuration
|
||||
template: src=ifcfg.j2 dest=/etc/sysconfig/network-scripts/ifcfg-{{ item.name }}
|
||||
loop: "{{ net_if }}"
|
||||
notify: reload network
|
||||
tags: net,conf
|
||||
|
||||
...
|
Reference in New Issue
Block a user