feat(proxmox): add hosts config
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
15
roles/proxmox/tasks/04_configure_hosts.yaml
Normal file
15
roles/proxmox/tasks/04_configure_hosts.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
- name: Configure /etc/hosts with Proxmox cluster nodes
|
||||
ansible.builtin.blockinfile:
|
||||
path: /etc/hosts
|
||||
block: |
|
||||
# Proxmox Cluster Nodes
|
||||
192.168.20.12 aya01.seyshiro.de aya01
|
||||
192.168.20.14 lulu.seyshiro.de lulu
|
||||
192.168.20.28 inko01.seyshiro.de inko01
|
||||
192.168.20.10 naruto01.seyshiro.de naruto01
|
||||
192.168.20.9 mii01.seyshiro.de mii01
|
||||
marker: "# {mark} ANSIBLE MANAGED BLOCK - PROXMOX CLUSTER NODES"
|
||||
create: true
|
||||
mode: "644"
|
||||
when: is_proxmox_node | bool
|
||||
@@ -6,5 +6,8 @@
|
||||
state: present
|
||||
loop: "{{ proxmox_node_dependencies }}"
|
||||
|
||||
- name: Configure hosts file for cluster nodes
|
||||
ansible.builtin.include_tasks: 04_configure_hosts.yaml
|
||||
|
||||
- name: Ensure Harware Acceleration on node
|
||||
ansible.builtin.include_tasks: 06_hardware_acceleration.yaml
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
dest: "{{ proxmox_dirs.isos }}/{{ distro.name }}"
|
||||
mode: "0644"
|
||||
when: not image_stat.stat.exists
|
||||
register: download_result
|
||||
|
||||
- name: Set raw image file name fact
|
||||
ansible.builtin.set_fact:
|
||||
@@ -24,5 +25,5 @@
|
||||
ansible.builtin.command:
|
||||
cmd: "qemu-img convert -O raw {{ proxmox_dirs.isos }}/{{ distro.name }} {{ proxmox_dirs.isos }}/{{ raw_image_name }}"
|
||||
when:
|
||||
- download_result is changed or not raw_image_stat.stat.exists
|
||||
- (download_result is defined and download_result is changed) or not raw_image_stat.stat.exists
|
||||
- image_stat.stat.exists
|
||||
|
||||
Reference in New Issue
Block a user