added debian-to-pve playbook

This commit is contained in:
Bryan Joshua Pedini 2022-09-11 19:11:08 +02:00
parent 46704c6b34
commit e311127a98
6 changed files with 60 additions and 0 deletions

14
debian-to-pve.yml Normal file
View File

@ -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

View File

@ -0,0 +1,5 @@
---
- hosts: all
become: true
tasks:
- import_tasks: tasks/debian-to-pve/post-pve-installation.yml

View File

@ -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

View File

@ -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

View File

@ -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

4
vars/debian-to-pve.yml Normal file
View File

@ -0,0 +1,4 @@
---
HOSTNAME: pve01.example.com
HOSTNAME_SHORT: pve01
PUBLIC_IP: 192.168.1.101