refactor: reorganize proxmox roles, add hardware acceleration, and update common config tasks
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
@@ -45,25 +45,20 @@
|
||||
ansible.builtin.set_fact:
|
||||
vm_found_ip: "{{ vm_nmap_scan.stdout | regex_search('Nmap scan report for ([0-9\\.]+)', '\\1') | first }}"
|
||||
|
||||
- name: Define SSH config block
|
||||
ansible.builtin.set_fact:
|
||||
ssh_entry: |
|
||||
Host {{ vm.name }}
|
||||
HostName {{ vm_found_ip }}
|
||||
Port 22
|
||||
User {{ user }}
|
||||
IdentityFile {{ pk_path }}
|
||||
IdentityFile ~/.ssh/id_ed25519
|
||||
IdentityFile ~/.ssh/id_ed25519-cert.pub
|
||||
ProxyJump {{ vm.node }}
|
||||
StrictHostKeyChecking no
|
||||
|
||||
- name: Append new VM to SSH config
|
||||
- name: Append new VM to SSH config "{{ vm.name }}"
|
||||
ansible.builtin.blockinfile:
|
||||
path: "{{ ansible_env.HOME }}/.ssh/config_homelab"
|
||||
marker: "# {mark} HOMELAB VMS BLOCK"
|
||||
marker: "# {mark} HOMELAB VM: {{ vm.name }} BLOCK"
|
||||
block: |
|
||||
{{ ssh_entry }}
|
||||
Host {{ vm.name }}
|
||||
HostName {{ vm_found_ip }}
|
||||
Port 22
|
||||
User {{ user }}
|
||||
IdentityFile {{ pk_path }}
|
||||
IdentityFile ~/.ssh/id_ed25519
|
||||
IdentityFile ~/.ssh/id_ed25519-cert.pub
|
||||
ProxyJump {{ vm.node }}
|
||||
StrictHostKeyChecking no
|
||||
|
||||
- name: Add VM to homelab_vms group in production.ini
|
||||
ansible.builtin.lineinfile:
|
||||
|
||||
Reference in New Issue
Block a user