Skip to content

Commit

Permalink
Add an Ansible playbook to backup my Proxmox servers
Browse files Browse the repository at this point in the history
  • Loading branch information
Antiz96 committed Nov 18, 2024
1 parent 1a06cfb commit 25466e1
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Ansible-Playbooks/proxmox_system_backup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: "Proxmox System Backup"
hosts: all
roles:
- role: "proxmox_system_backup"
2 changes: 2 additions & 0 deletions Ansible-Playbooks/roles/proxmox_system_backup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Proxmox System Backup
=====================
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# defaults file for proxmox_system_backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# handlers file for proxmox_system_backup
52 changes: 52 additions & 0 deletions Ansible-Playbooks/roles/proxmox_system_backup/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
galaxy_info:
author: your name
description: your role description
company: your company (optional)

# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker

# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)

min_ansible_version: 2.1

# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:

#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99

galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.

dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
15 changes: 15 additions & 0 deletions Ansible-Playbooks/roles/proxmox_system_backup/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# tasks file for proxmox_system_backup

# Perform a full system backup of my Proxmox servers
- name: Proxmox System Backup
ansible.builtin.shell:
cmd: system-backup --create --scheduled
register: proxmox_system_backup
changed_when: true

# Print the output of the backup (to check that the backup went correctly)
- name: Proxmox System Backup output
ansible.builtin.debug:
msg: "{{ proxmox_system_backup.stdout_lines }}"
when: proxmox_system_backup.stdout_lines | length > 0
2 changes: 2 additions & 0 deletions Ansible-Playbooks/roles/proxmox_system_backup/tests/inventory
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
localhost

5 changes: 5 additions & 0 deletions Ansible-Playbooks/roles/proxmox_system_backup/tests/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- proxmox_system_backup
2 changes: 2 additions & 0 deletions Ansible-Playbooks/roles/proxmox_system_backup/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# vars file for proxmox_system_backup

0 comments on commit 25466e1

Please sign in to comment.