-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_proxmox.yml
executable file
·73 lines (73 loc) · 2.31 KB
/
install_proxmox.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/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: Update cache
ansible.builtin.apt:
update_cache: true
- 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
- lm-sensors
- ncdu
- nut
- prometheus-node-exporter
- python3
- stress-ng
- tmux
- vim
state: present
- name: Enable node-exporter
ansible.builtin.service:
name: prometheus-node-exporter
enabled: true
state: started