2025-07-10 21:24:28 -06:00

47 lines
1012 B
YAML

---
- name: Set up network interfaces for new PVE node
template:
src: interfaces-xbazzi.j2
# dest: /etc/network/interfaces.d/interfaces-xbazzi
dest: /etc/network/interfaces
owner: root
group: root
mode: "0644"
- name: Apply correct permissions to interfaces.d
file:
path: "/etc/network/interfaces.d"
owner: root
group: root
mode: '0644'
- name: Find all files in the directory
ansible.builtin.find:
paths: /etc/network/interfaces.d/
file_type: file
register: files_to_delete
- name: Delete all files
ansible.builtin.file:
path: "{{ item.path }}"
state: absent
loop: "{{ files_to_delete.files }}"
- name: Update /etc/hosts with all PVE nodes
template:
src: hosts.j2
dest: /etc/hosts
mode: "0644"
- name: Ensure search domain and nameserver set properly
template:
src: resolv.j2
dest: /etc/resolv.conf
mode: "0644"
- name: Restart networking
ansible.builtin.systemd:
name: networking
state: restarted