pve init
This commit is contained in:
		
							
								
								
									
										27
									
								
								proxmox/general.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								proxmox/general.yaml
									
									
									
									
									
										Normal 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
 | 
			
		||||
		Reference in New Issue
	
	Block a user