Add Proxmox network interfaces config
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user