diff --git a/debian-to-pve.yml b/debian-to-pve.yml new file mode 100644 index 0000000..b603f96 --- /dev/null +++ b/debian-to-pve.yml @@ -0,0 +1,14 @@ +--- +- hosts: all + become: true + tasks: + - name: Import related variables + ansible.builtin.include_vars: + file: debian-to-pve.yml + - import_tasks: tasks/debian-general/hostname.yml + - import_tasks: tasks/debian-general/resolv-conf.yml + - import_tasks: tasks/debian-general/hosts-file.yml + - import_tasks: tasks/debian-general/repositories-bullseye.yml + - import_tasks: tasks/debian-to-pve/repositories.yml + - import_tasks: tasks/debian-general/upgrade.yml + - import_tasks: tasks/debian-to-pve/pve-server.yml diff --git a/post-pve-installation.yml b/post-pve-installation.yml new file mode 100644 index 0000000..779e0a3 --- /dev/null +++ b/post-pve-installation.yml @@ -0,0 +1,5 @@ +--- +- hosts: all + become: true + tasks: + - import_tasks: tasks/debian-to-pve/post-pve-installation.yml diff --git a/tasks/debian-to-pve/post-pve-installation.yml b/tasks/debian-to-pve/post-pve-installation.yml new file mode 100644 index 0000000..c30c195 --- /dev/null +++ b/tasks/debian-to-pve/post-pve-installation.yml @@ -0,0 +1,11 @@ +--- +- name: Ensure the Debian stock kernel and os-prober are uninstalled + ansible.builtin.apt: + name: + - linux-image-amd64 + - linux-image-5.10* + - os-prober + state: absent +- name: Ensure grub gets updated + ansible.builtin.shell: + cmd: update-grub diff --git a/tasks/debian-to-pve/pve-server.yml b/tasks/debian-to-pve/pve-server.yml new file mode 100644 index 0000000..5c958d6 --- /dev/null +++ b/tasks/debian-to-pve/pve-server.yml @@ -0,0 +1,11 @@ +--- +- import_tasks: ../debian-general/update.yml +- name: Ensure PVE is installed and updated + ansible.builtin.apt: + update_cache: yes + cache_valid_time: 0 + name: + - proxmox-ve + - postfix + - open-iscsi + state: latest diff --git a/tasks/debian-to-pve/repositories.yml b/tasks/debian-to-pve/repositories.yml new file mode 100644 index 0000000..a3f7286 --- /dev/null +++ b/tasks/debian-to-pve/repositories.yml @@ -0,0 +1,15 @@ +--- +- name: Ensure the PVE Enterprise repository is disabled + ansible.builtin.copy: + dest: /etc/apt/sources.list.d/pve-enterprise.list + content: | + #deb https://enterprise.proxmox.com/debian/pve bullseye pve-enterprise +- name: Ensure the correct Proxmox repositories are in place + ansible.builtin.copy: + dest: /etc/apt/sources.list.d/pve-no-subscription.list + content: | + deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription +- name: Ensure the Proxmox signing GPG key is present + ansible.builtin.get_url: + dest: /etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg + url: https://enterprise.proxmox.com/debian/proxmox-release-bullseye.gpg diff --git a/vars/debian-to-pve.yml b/vars/debian-to-pve.yml new file mode 100644 index 0000000..164aaf9 --- /dev/null +++ b/vars/debian-to-pve.yml @@ -0,0 +1,4 @@ +--- +HOSTNAME: pve01.example.com +HOSTNAME_SHORT: pve01 +PUBLIC_IP: 192.168.1.101