diff --git a/plugins/modules/proxmox_backup.py b/plugins/modules/proxmox_backup.py index c3e28da957..dd676f7416 100644 --- a/plugins/modules/proxmox_backup.py +++ b/plugins/modules/proxmox_backup.py @@ -241,60 +241,60 @@ extends_documentation_fragment: EXAMPLES = ''' - 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 + 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 + 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 + 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 + 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 + 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 ''' diff --git a/tests/integration/targets/proxmox/aliases b/tests/integration/targets/proxmox/aliases index 5e5957a5c2..f93d854fef 100644 --- a/tests/integration/targets/proxmox/aliases +++ b/tests/integration/targets/proxmox/aliases @@ -7,3 +7,4 @@ proxmox_domain_info proxmox_group_info proxmox_user_info proxmox_storage_info +proxmox_backup diff --git a/tests/integration/targets/proxmox/tasks/main.yml b/tests/integration/targets/proxmox/tasks/main.yml index 1b529d1112..53fb23c879 100644 --- a/tests/integration/targets/proxmox/tasks/main.yml +++ b/tests/integration/targets/proxmox/tasks/main.yml @@ -613,3 +613,59 @@ - results.proxmox_nodes is defined - results.proxmox_nodes|length >= 1 - 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