diff --git a/group_vars/proxmox.yml b/group_vars/proxmox.yml new file mode 100644 index 0000000..e425179 --- /dev/null +++ b/group_vars/proxmox.yml @@ -0,0 +1,2 @@ +--- +ansible_python_interpreter: /usr/bin/python3 diff --git a/install_proxmox.yml b/install_proxmox.yml new file mode 100755 index 0000000..cfd8c09 --- /dev/null +++ b/install_proxmox.yml @@ -0,0 +1,67 @@ +#!/usr/bin/env ansible-playbook +--- +# install proxmox on top of debian 12 according to: +# https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_12_Bookworm +- name: Install + configure proxmox + hosts: proxmox + user: root + tasks: + - name: Fetch proxmox gpg key + ansible.builtin.get_url: + url: https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg + dest: /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg + # yamllint disable rule:line-length + checksum: sha512:7da6fe34168adc6e479327ba517796d4702fa2f8b4f0a9833f5ea6e6b48f6507a6da403a274fe201595edc86a84463d50383d07f64bdde2e3658108db7d6dc87 + # yamllint enable rule:line-length + owner: root + group: root + mode: "0644" + - name: Add Proxmox repository + ansible.builtin.apt_repository: + filename: proxmox + # yamllint disable rule:line-length + repo: deb [arch=amd64] http://download.proxmox.com/debian/pve bookworm pve-no-subscription + # yamllint enable rule:line-length + state: present + - name: Upgrade + ansible.builtin.apt: + update_cache: true + upgrade: full + - name: Install proxmox kernel + ansible.builtin.apt: + name: proxmox-default-kernel + state: present + - name: Inform the user to reboot if necessary + when: 'not "pve" in ansible_kernel' + ansible.builtin.debug: + msg: "Need to reboot into PVE kernel!" + - name: Install packages which depend on pve kernel + when: '"pve" in ansible_kernel' + ansible.builtin.apt: + name: + - chrony + - open-iscsi + - postfix + - proxmox-ve + state: present + - name: Remove debian packages + when: '"pve" in ansible_kernel' + ansible.builtin.apt: + name: + - linux-image-amd64 + - 'linux-image-6.1*' + - os-prober + state: absent + - name: Install misc useful packages + ansible.builtin.apt: + name: + - btop + - htop + - ipmitool + - ncdu + - nut + - python3 + - stress-ng + - tmux + - vim + state: present