Compare commits
2 Commits
0a18c43555
...
8289e73119
| Author | SHA1 | Date | |
|---|---|---|---|
| 8289e73119 | |||
| fe78fd6fe7 |
32
tasks/proxmox.yml
Normal file
32
tasks/proxmox.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
- name: Deploy VM templates
|
||||
hosts: proxmox
|
||||
|
||||
tasks:
|
||||
- name: Install proxmoxer from APT
|
||||
ansible.builtin.apt:
|
||||
name: python3-proxmoxer
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
- name: Install lm-sensors from APT
|
||||
ansible.builtin.apt:
|
||||
name: lm-sensors
|
||||
state: present
|
||||
|
||||
- name: Clone PVE-mods repository
|
||||
ansible.builtin.git:
|
||||
repo: "https://github.com/Meliox/PVE-mods.git"
|
||||
dest: "/opt/PVE-mods"
|
||||
version: "main"
|
||||
update: yes
|
||||
|
||||
- name: Install pve-mod-gui-sensors.sh
|
||||
ansible.builtin.copy:
|
||||
src: "/opt/PVE-mods/pve-mod-gui-sensors.sh"
|
||||
dest: "/usr/local/bin/pve-mod-gui-sensors.sh"
|
||||
mode: "0755"
|
||||
|
||||
- name: Run script with predefined input
|
||||
ansible.builtin.shell: |
|
||||
printf "a\nC\nN\n2\n" | /usr/local/bin/pve-mod-gui-sensors.sh
|
||||
|
||||
@@ -50,29 +50,14 @@
|
||||
- ubuntu
|
||||
- debian
|
||||
|
||||
proxmox_template_vm_fedora_image: Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2
|
||||
proxmox_template_vm_fedora_image_url: https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2
|
||||
proxmox_template_vm_ubuntu_image: jammy-server-cloudimg-amd64.img
|
||||
proxmox_template_vm_ubuntu_image_url: https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
|
||||
proxmox_template_vm_debian_image: debian-13-genericcloud-amd64-20251117-2299.qcow2
|
||||
proxmox_template_vm_debian_image_url: https://cloud.debian.org/images/cloud/trixie/20251117-2299/debian-13-genericcloud-amd64-20251117-2299.qcow2
|
||||
|
||||
|
||||
proxmox_template_vm_ubuntu_ostype: l26
|
||||
proxmox_template_vm_fedora_ostype: l26
|
||||
proxmox_template_vm_debian_ostype: l26
|
||||
proxmox_template_vm_ubuntu_osvariant: ubuntu-20.04
|
||||
|
||||
proxmox_template_vm_debian_name: debian-template
|
||||
proxmox_template_vm_debian_memory: 4096
|
||||
proxmox_template_vm_debian_cores: 2
|
||||
proxmox_template_vm_debian_storage: local-lvm
|
||||
|
||||
|
||||
# Required to provide at least one
|
||||
proxmox_template_vm_distros:
|
||||
- debian
|
||||
- ubuntu
|
||||
|
||||
# Required proxmox credentials
|
||||
proxmox_template_vm_proxmox_username: "{{ proxmox_username }}" # From Ansible vault
|
||||
@@ -81,26 +66,15 @@
|
||||
|
||||
|
||||
# Optional customizations for debian
|
||||
proxmox_template_vm_debian_storage: "local-lvm"
|
||||
proxmox_template_vm_debian_name: debian-40-template
|
||||
proxmox_template_vm_debian_name: debian-template
|
||||
proxmox_template_vm_debian_memory: 2048
|
||||
proxmox_template_vm_debian_cores: 1
|
||||
proxmox_template_vm_debian_cores: 2
|
||||
proxmox_template_vm_debian_storage: local-lvm
|
||||
proxmox_template_vm_debian_ciuser: "{{ ciuser }}" # From Ansible vault
|
||||
proxmox_template_vm_debian_cipassword: "{{ cipassword }}" # From Ansible vault
|
||||
proxmox_template_vm_debian_sshkeys: "{{ ssh_public_keys | join('\n') }}" # gets your ssh key from /home/user/.ssh/id_rsa.pub -- customize this to your needs
|
||||
# proxmox_template_vm_debian_vlan: 50
|
||||
|
||||
# Optional customizations for ubuntu
|
||||
proxmox_template_vm_ubuntu_storage: "local-lvm"
|
||||
proxmox_template_vm_ubuntu_name: ubuntu-2204-template
|
||||
proxmox_template_vm_ubuntu_memory: 4096
|
||||
proxmox_template_vm_ubuntu_cores: 1
|
||||
proxmox_template_vm_ubuntu_ciuser: "{{ ciuser }}" # From Ansible vault
|
||||
proxmox_template_vm_ubuntu_cipassword: "{{ cipassword }}" # From Ansible vault
|
||||
# proxmox_template_vm_ubuntu_sshkeys: "{{ lookup('file', lookup('env', 'HOME') + '/.ssh/id_rsa.pub') }}" # gets your ssh key from /home/user/.ssh/id_rsa.pub -- customize this to your needs
|
||||
proxmox_template_vm_ubuntu_sshkeys: "{{ ssh_public_keys | join('\n') }}" # gets your ssh key from /home/user/.ssh/id_rsa.pub -- customize this to your needs
|
||||
# proxmox_template_vm_ubuntu_vlan: 50
|
||||
|
||||
# Set to true if you have slow storage to avoid file locks
|
||||
proxmox_template_vm_slow_storage: true
|
||||
|
||||
@@ -125,28 +99,10 @@
|
||||
cipassword: "{{ cipassword }}"
|
||||
# sshkeys: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}"
|
||||
storage: local-lvm
|
||||
disk_size: 32G
|
||||
disk_size: 8G
|
||||
# vlan: 50
|
||||
ip_address: 192.168.2.98/24
|
||||
gateway: 192.168.2.1
|
||||
nameservers:
|
||||
- 192.168.2.100
|
||||
- 8.8.8.8
|
||||
|
||||
- name: vm-02
|
||||
vmid: 1001
|
||||
template: 9413
|
||||
memory: 4096
|
||||
cores: 1
|
||||
node: node0 # The hostname of the node that the VM will be created on
|
||||
ciuser: "{{ ciuser }}"
|
||||
cipassword: "{{ cipassword }}"
|
||||
# sshkeys: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}"
|
||||
storage: local-lvm
|
||||
disk_size: 64G
|
||||
# vlan: 50
|
||||
ip_address: 192.168.2.99/24
|
||||
gateway: 192.168.2.1
|
||||
nameservers:
|
||||
- 192.168.2.100
|
||||
- 8.8.8.8
|
||||
Reference in New Issue
Block a user