added playbook debian-to-pbs

This commit is contained in:
Bryan Joshua Pedini 2022-04-06 12:06:01 +02:00
parent 8a38fb9f96
commit d44201be7c
6 changed files with 51 additions and 0 deletions

11
debian-to-pbs.yml Normal file
View File

@ -0,0 +1,11 @@
---
- hosts: all
become: true
tasks:
- 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-pbs/repositories.yml
- import_tasks: tasks/debian-general/upgrade.yml
- import_tasks: tasks/debian-to-pbs/pbs-server.yml

View File

@ -0,0 +1,4 @@
---
- name: Ensure hostname is set
ansible.builtin.hostname:
name: "{{ HOSTNAME_SHORT }}"

View File

@ -0,0 +1,8 @@
---
- name: Ensure the hosts file is properly configured
ansible.builtin.copy:
dest: /etc/hosts
content: |
127.0.0.1 localhost.localdomain localhost
::1 localhost.localdomain localhost
{{ PUBLIC_IP }} {{ HOSTNAME }} {{ HOSTNAME_SHORT }}

View File

@ -0,0 +1,5 @@
---
- name: Ensure /etc/resolv.conf is correct
ansible.builtin.copy:
dest: /etc/resolv.conf
content: "nameserver 1.1.1.1\nnameserver 1.0.0.1"

View File

@ -0,0 +1,8 @@
---
- import_tasks: ../debian-general/update.yml
- name: Ensure PBS is installed and updated
ansible.builtin.apt:
update_cache: yes
cache_valid_time: 0
name: proxmox-backup
state: latest

View File

@ -0,0 +1,15 @@
---
- name: Ensure the PBS Enterprise respository is disabled
ansible.builtin.copy:
dest: /etc/apt/sources.list.d/pbs-enterprise.list
content: |
#deb https://enterprise.proxmox.com/debian/pbs bullseye pbs-enterprise
- name: Ensure the correct Proxmox repositories are in place
ansible.builtin.copy:
dest: /etc/apt/sources.list.d/pbs-no-subscription.list
content: |
deb http://download.proxmox.com/debian/pbs bullseye pbs-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