ngine_io / ngine_io.cloudstack / 2.3.0 / module / cs_snapshot_policy Manages volume snapshot policies on Apache CloudStack based clouds. | "added in version" 0.1.0 of ngine_io.cloudstack" Authors: René Moser (@resmo)ngine_io.cloudstack.cs_snapshot_policy (2.3.0) — module
Install with ansible-galaxy collection install ngine_io.cloudstack:==2.3.0
collections: - name: ngine_io.cloudstack version: 2.3.0
Create, update and delete volume snapshot policies.
- name: ensure a snapshot policy daily at 1h00 UTC ngine_io.cloudstack.cs_snapshot_policy: volume: ROOT-478 schedule: '00:1' max_snaps: 3
- name: ensure a snapshot policy daily at 1h00 UTC on the second DATADISK of VM web-01 ngine_io.cloudstack.cs_snapshot_policy: vm: web-01 volume_type: DATADISK device_id: 2 schedule: '00:1' max_snaps: 3
- name: ensure a snapshot policy hourly at minute 5 UTC ngine_io.cloudstack.cs_snapshot_policy: volume: ROOT-478 schedule: '5' interval_type: hourly max_snaps: 1
- name: ensure a snapshot policy weekly on Sunday at 05h00, TZ Europe/Zurich ngine_io.cloudstack.cs_snapshot_policy: volume: ROOT-478 schedule: '00:5:1' interval_type: weekly max_snaps: 1 time_zone: 'Europe/Zurich'
- name: ensure a snapshot policy is absent ngine_io.cloudstack.cs_snapshot_policy: volume: ROOT-478 interval_type: hourly state: absent
vm: description: - Name of the instance to select the volume from. - Use I(volume_type) if VM has a DATADISK and ROOT volume. - In case of I(volume_type=DATADISK), additionally use I(device_id) if VM has more than one DATADISK volume. - Either I(volume) or I(vm) is required. type: str vpc: description: - Name of the vpc the instance is deployed in. type: str state: choices: - present - absent default: present description: - State of the snapshot policy. type: str domain: description: - Domain the volume is related to. type: str volume: description: - Name of the volume. - Either I(volume) or I(vm) is required. type: str account: description: - Account the volume is related to. type: str api_key: description: - API key of the CloudStack API. - If not given, the C(CLOUDSTACK_KEY) env variable is considered. required: true type: str api_url: description: - URL of the CloudStack API e.g. https://cloud.example.com/client/api. - If not given, the C(CLOUDSTACK_ENDPOINT) env variable is considered. required: true type: str project: description: - Name of the project the volume is related to. type: str schedule: description: - Time the snapshot is scheduled. Required if I(state=present). - 'Format for I(interval_type=HOURLY): C(MM)' - 'Format for I(interval_type=DAILY): C(MM:HH)' - 'Format for I(interval_type=WEEKLY): C(MM:HH:DD (1-7))' - 'Format for I(interval_type=MONTHLY): C(MM:HH:DD (1-28))' type: str device_id: description: - ID of the device on a VM the volume is attached to. - This will only be considered if VM has multiple DATADISK volumes. type: int max_snaps: aliases: - max default: 8 description: - Max number of snapshots. type: int time_zone: aliases: - timezone default: UTC description: - Specifies a timezone for this command. type: str api_secret: description: - Secret key of the CloudStack API. - If not set, the C(CLOUDSTACK_SECRET) env variable is considered. required: true type: str api_timeout: default: 10 description: - HTTP timeout in seconds. - If not given, the C(CLOUDSTACK_TIMEOUT) env variable is considered. type: int volume_type: choices: - DATADISK - ROOT description: - Type of the volume. type: str interval_type: aliases: - interval choices: - hourly - daily - weekly - monthly default: daily description: - Interval of the snapshot. type: str api_http_method: choices: - get - post default: get description: - HTTP method used to query the API endpoint. - If not given, the C(CLOUDSTACK_METHOD) env variable is considered. type: str api_verify_ssl_cert: description: - Verify CA authority cert file. - If not given, the C(CLOUDSTACK_VERIFY) env variable is considered. type: str
account: description: Account the volume is related to. returned: success sample: example account type: str domain: description: Domain the volume is related to. returned: success sample: example domain type: str id: description: UUID of the snapshot policy. returned: success sample: a6f7a5fc-43f8-11e5-a151-feff819cdc9f type: str interval_type: description: interval type of the snapshot policy. returned: success sample: daily type: str max_snaps: description: maximum number of snapshots retained. returned: success sample: 10 type: int project: description: Name of project the volume is related to. returned: success sample: Production type: str schedule: description: schedule of the snapshot policy. returned: success sample: null type: str time_zone: description: the time zone of the snapshot policy. returned: success sample: Etc/UTC type: str volume: description: the volume of the snapshot policy. returned: success sample: Etc/UTC type: str zone: description: Name of zone the volume is related to. returned: success sample: ch-gva-2 type: str