Add Proxmox network interfaces config

This commit is contained in:
Arti Zirk
2025-08-02 16:42:42 +03:00
parent d0b8dfd16f
commit 141996c2b7
13 changed files with 115 additions and 16 deletions

View File

@@ -1,17 +1,16 @@
---
- name: PVE base configuration
hosts: proxmox
tasks:
- name: Generate ipid
set_fact:
new_fact: "{{ inventory_hostname | regex_replace('pve', '') }}"
gather_facts: false
serial: 1 # one host at a time
tasks:
- name: UI primary IP (/etc/hosts)
tags: network
ansible.builtin.lineinfile:
path: /etc/hosts
regexp: ' {{ inventory_hostname_short }}$'
line: '2001:bb8:4008:21:20::{{ ipid }} {{ inventory_hostname }} {{ inventory_hostname_short }}'
regexp: ' {{ inventory_hostname_short }}$'
line: '{{ primary_ipv6 | split("/") | first }} {{ inventory_hostname }} {{ inventory_hostname_short }}'
- name: /etc/network/interfaces
tags: network