pez-infra/ansible/roles/proxmox_ve/tasks/main.yml
Rasmus "Pez" Wejlgaard 69145b3089
Some checks are pending
Deploy (on merge) / Discover hosts (push) Waiting to run
Deploy (on merge) / Deploy → (push) Blocked by required conditions
fix: add smb mount (#107)
* fix: add smb mount

* update secrets

* address linting issues
2026-05-14 20:49:25 +01:00

66 lines
2 KiB
YAML

---
# Configure Proxmox VE apt sources for the no-subscription tier.
# Removes the enterprise repo (requires paid subscription) and enables
# the free no-subscription repo so apt update works without credentials.
- name: Remove PVE enterprise apt source
ansible.builtin.file:
path: /etc/apt/sources.list.d/pve-enterprise.list
state: absent
- name: Remove Ceph enterprise apt source
ansible.builtin.file:
path: /etc/apt/sources.list.d/ceph.list
state: absent
- name: Add PVE no-subscription apt source
ansible.builtin.copy:
dest: /etc/apt/sources.list.d/pve-no-subscription.list
content: "deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription\n"
owner: root
group: root
mode: "0644"
notify: Update apt cache
- name: Update apt cache
ansible.builtin.apt:
update_cache: true
# Patch is re-applied automatically on each Ansible run, which handles pve-manager package updates
# reverting the file.
- name: Suppress Proxmox subscription nag dialog
ansible.builtin.replace:
path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
regexp: "if \\(res === null \\|\\| res === undefined \\|\\| !res \\|\\| res\\.data\\.status\\.toLowerCase\\(\\) !== 'active'\\)"
replace: "if (false)"
notify: Restart pveproxy
- name: Allow Proxmox web UI on Tailscale only
community.general.ufw:
rule: allow
port: "8006"
proto: tcp
interface: tailscale0
direction: in
comment: "Proxmox web UI - Tailscale only"
notify: Reload ufw
# --- Storage ---
- name: Check if hdd CIFS storage is configured
ansible.builtin.command: pvesh get /storage/hdd
register: proxmox_ve_hdd_check
changed_when: false
failed_when: false
- name: Add hdd CIFS storage (london-b /pve share)
ansible.builtin.command: >-
pvesm add cifs hdd
--server 100.84.65.101
--share pve
--username {{ proxmox_ve_smb_user }}
--password {{ proxmox_ve_smb_password }}
--content images,backup,import,snippets,vztmpl,rootdir,iso
no_log: true
changed_when: true
when: proxmox_ve_hdd_check.rc != 0