1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

feat/upload proxmox backup module

This commit is contained in:
Dylan LEVERRIER 2024-05-14 19:48:34 +02:00
parent 7f0ec6f337
commit 3a51ccd55a
3 changed files with 103 additions and 46 deletions

View file

@ -241,60 +241,60 @@ extends_documentation_fragment:
EXAMPLES = ''' EXAMPLES = '''
- name: List all backup jobs - name: List all backup jobs
community.general.proxmox_backup: community.general.proxmox_backup:
api_host: "node1" api_host: "node1"
api_user: user@realm api_user: user@realm
api_password: password api_password: password
validate_certs: false validate_certs: false
state: list state: list
register: backup_result register: backup_result
- name: Show current backup job - name: Show current backup job
ansible.builtin.debug: ansible.builtin.debug:
var: backup_result var: backup_result
- name: Create backup with id backup-20bad73a-d245 - name: Create backup with id backup-20bad73a-d245
community.general.proxmox_backup: community.general.proxmox_backup:
api_host: "node1" api_host: "node1"
api_token_id: "token_id" api_token_id: "token_id"
api_token_secret: "token_secret" api_token_secret: "token_secret"
validate_certs: false validate_certs: false
id: "backup-20bad73a-d245" id: "backup-20bad73a-d245"
vmid: "103" vmid: "103"
mode: "snapshot" mode: "snapshot"
mailnotification: "always" mailnotification: "always"
mailto: "preprod@idnow.io" mailto: "preprod@idnow.io"
repeat_missed: 0 repeat_missed: 0
enabled: 1 enabled: 1
prune_backups: prune_backups:
keep_yearly: "6" keep_yearly: "6"
keep_weekly: "5" keep_weekly: "5"
keep_hourly: "4" keep_hourly: "4"
keep_daily: "2" keep_daily: "2"
keep_last: "1" keep_last: "1"
keep_monthly: "3" keep_monthly: "3"
storage: "backup-idcheck-preprod-0" storage: "backup-idcheck-preprod-0"
schedule: "*-*-* 22:00:00" schedule: "*-*-* 22:00:00"
state: present state: present
- name: Delete backup job - name: Delete backup job
community.general.proxmox_backup: community.general.proxmox_backup:
api_host: "node1" api_host: "node1"
api_token_id: "token_id" api_token_id: "token_id"
api_token_secret: "token_secret" api_token_secret: "token_secret"
validate_certs: false validate_certs: false
id: "backup-20bad73a-d245" id: "backup-20bad73a-d245"
state: absent state: absent
- name: Update backup with id backup-20bad73a-d245 (Change VM ID backuped) - name: Update backup with id backup-20bad73a-d245 (Change VM ID backuped)
community.general.proxmox_backup: community.general.proxmox_backup:
api_host: "node1" api_host: "node1"
api_token_id: "token_id" api_token_id: "token_id"
api_token_secret: "token_secret" api_token_secret: "token_secret"
validate_certs: false validate_certs: false
id: "backup-20bad73a-d245" id: "backup-20bad73a-d245"
vmid: "111" vmid: "111"
state: present state: present
''' '''

View file

@ -7,3 +7,4 @@ proxmox_domain_info
proxmox_group_info proxmox_group_info
proxmox_user_info proxmox_user_info
proxmox_storage_info proxmox_storage_info
proxmox_backup

View file

@ -613,3 +613,59 @@
- results.proxmox_nodes is defined - results.proxmox_nodes is defined
- results.proxmox_nodes|length >= 1 - results.proxmox_nodes|length >= 1
- results.proxmox_nodes[0].type == 'node' - results.proxmox_nodes[0].type == 'node'
- name: List all backup jobs
community.general.proxmox_backup:
api_host: "node1"
api_user: user@realm
api_password: password
validate_certs: false
state: list
register: backup_result
- name: Show current backup job
ansible.builtin.debug:
var: backup_result
- name: Create backup with id backup-20bad73a-d245
community.general.proxmox_backup:
api_host: "node1"
api_token_id: "token_id"
api_token_secret: "token_secret"
validate_certs: false
id: "backup-20bad73a-d245"
vmid: "103"
mode: "snapshot"
mailnotification: "always"
mailto: "preprod@idnow.io"
repeat_missed: 0
enabled: 1
prune_backups:
keep_yearly: "6"
keep_weekly: "5"
keep_hourly: "4"
keep_daily: "2"
keep_last: "1"
keep_monthly: "3"
storage: "backup-idcheck-preprod-0"
schedule: "*-*-* 22:00:00"
state: present
- name: Delete backup job
community.general.proxmox_backup:
api_host: "node1"
api_token_id: "token_id"
api_token_secret: "token_secret"
validate_certs: false
id: "backup-20bad73a-d245"
state: absent
- name: Update backup with id backup-20bad73a-d245 (Change VM ID backuped)
community.general.proxmox_backup:
api_host: "node1"
api_token_id: "token_id"
api_token_secret: "token_secret"
validate_certs: false
id: "backup-20bad73a-d245"
vmid: "111"
state: present