This commit is contained in:
2025-08-02 15:57:42 +03:00
parent c1d68ac015
commit d0b8dfd16f
2 changed files with 35 additions and 8 deletions

27
proxmox/general.yaml Normal file
View File

@@ -0,0 +1,27 @@
---
- name: PVE base configuration
hosts: proxmox
tasks:
- name: Generate ipid
set_fact:
new_fact: "{{ inventory_hostname | regex_replace('pve', '') }}"
- 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 }}'
- name: /etc/network/interfaces
tags: network
ansible.builtin.template:
src: templates/network.interfaces.j2
dest: /etc/network/interfaces
notify: reload networking
handlers:
- name: reload networking
ansible.builtin.systemd_service:
name: networking.service
state: reloaded