blse2-public/common-debian/tasks/network.yml

34 lines
750 B
YAML
Raw Permalink Normal View History

2023-05-05 15:47:27 -04:00
---
- name: disable managed /etc/hosts from cloud-init
lineinfile:
dest: /etc/cloud/cloud.cfg
regexp: "^manage_etc_hosts"
line: " manage_etc_hosts:false"
ignore_errors: yes
- name: write hosts configuration file
template:
src: etc/hosts.j2
dest: /etc/hosts
mode: 0644
- name: write resolver configuration files
template:
src: "{{ item }}.j2"
dest: "/{{ item }}"
mode: 0644
loop:
- etc/dhcp/dhclient-enter-hooks.d/noresolv
- etc/resolv.conf
ignore_errors: yes
- name: write firewall rules configuration file
template:
src: etc/nftables.conf.j2
dest: /etc/nftables.conf
when: nftables_rules is defined and nftables_rules
notify:
- restart nftables
- meta: flush_handlers