From aae782a66bbf5258f9d34c781cf4dac5996729b7 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Fri, 14 Jul 2023 14:17:44 +0200 Subject: [PATCH] Add role to set up base Proxmox server --- roles/proxmox/handlers/main.yml | 2 ++ roles/proxmox/tasks/main.yml | 16 ++++++++++++++++ roles/proxmox/tasks/sdn.yml | 9 +++++++++ 3 files changed, 27 insertions(+) create mode 100644 roles/proxmox/handlers/main.yml create mode 100644 roles/proxmox/tasks/main.yml create mode 100644 roles/proxmox/tasks/sdn.yml diff --git a/roles/proxmox/handlers/main.yml b/roles/proxmox/handlers/main.yml new file mode 100644 index 0000000..851b949 --- /dev/null +++ b/roles/proxmox/handlers/main.yml @@ -0,0 +1,2 @@ +- name: reload interfaces + command: ifreload -a diff --git a/roles/proxmox/tasks/main.yml b/roles/proxmox/tasks/main.yml new file mode 100644 index 0000000..e53cb35 --- /dev/null +++ b/roles/proxmox/tasks/main.yml @@ -0,0 +1,16 @@ +- name: Disable enterprise repositories + apt_repository: + repo: '{{ item }}' + state: absent + update_cache: '{{ ansible_loop.last }}' + loop: + - 'deb https://enterprise.proxmox.com/debian/pve {{ ansible_distribution_release }} pve-enterprise' + - 'deb https://enterprise.proxmox.com/debian/ceph-quincy {{ ansible_distribution_release }} enterprise' + loop_control: + extended: true + +- name: Enable no-subscription repository + apt_repository: + repo: 'deb http://download.proxmox.com/debian/pve {{ ansible_distribution_release }} pve-no-subscription' + +- include_tasks: sdn.yml diff --git a/roles/proxmox/tasks/sdn.yml b/roles/proxmox/tasks/sdn.yml new file mode 100644 index 0000000..99cf402 --- /dev/null +++ b/roles/proxmox/tasks/sdn.yml @@ -0,0 +1,9 @@ +- name: Install packages for SDN + package: + name: libpve-network-perl + +- name: Source SDN network configuration + lineinfile: + path: /etc/network/interfaces + line: 'source /etc/network/interfaces.d/*' + notify: reload interfaces