61 lines
1.5 KiB
YAML
61 lines
1.5 KiB
YAML
- name: Install Proxmox
|
|
hosts: proxmox
|
|
tasks:
|
|
|
|
- name: Install Default Packages
|
|
ansible.builtin.apt:
|
|
name: "{{ item }}"
|
|
state: present
|
|
update_cache: yes
|
|
with_items:
|
|
- apt-transport-https
|
|
- ca-certificates
|
|
- curl
|
|
- wget
|
|
- git
|
|
- software-properties-common
|
|
|
|
- name: Set Hostname
|
|
ansible.builtin.hostname:
|
|
name: "{{ inventory_hostname }}"
|
|
use: systemd
|
|
|
|
- name: Set /etc/hosts
|
|
ansible.builtin.shell: "echo '{{ ansible_ssh_host }} {{ inventory_hostname }}' >> /etc/hosts"
|
|
register: set_log
|
|
|
|
- name: Add REPO Key
|
|
ansible.builtin.command: "wget https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg"
|
|
|
|
- name: Add Repository
|
|
ansible.builtin.apt_repository:
|
|
repo: deb [arch=amd64] http://download.proxmox.com/debian/pve bookworm pve-no-subscription
|
|
state: present
|
|
|
|
- name: Upgrade Default Packages
|
|
ansible.builtin.apt:
|
|
update_cache: yes
|
|
upgrade: yes
|
|
register: upgrade_log
|
|
|
|
- name: Install Proxmox Kernel
|
|
ansible.builtin.apt:
|
|
pkg:
|
|
- pve-kernel-6.2
|
|
|
|
- name: Reboot Host {{ inventory_hostname }}
|
|
ansible.builtin.reboot:
|
|
reboot_timeout: 180
|
|
|
|
- name: Install Proxmox Packages
|
|
ansible.builtin.apt:
|
|
pkg:
|
|
- proxmox-ve
|
|
- postfix
|
|
- open-iscsi
|
|
register: install_pve
|
|
|
|
- name: Set Firewall Role
|
|
|
|
|
|
# - name: Set Firewall Role |