Files
ansible/proxmox/general.yaml
2025-08-02 15:57:42 +03:00

28 lines
788 B
YAML

---
- 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