ansible/test/integration/targets/cs_snapshot_policy/tasks/main.yml
Matt Martz 4fe08441be Deprecate tests used as filters (#32361)
* Warn on tests used as filters

* Update docs, add aliases for tests that fit more gramatically with test syntax

* Fix rst formatting

* Add successful filter, alias of success

* Remove renamed_deprecation, it was overkill

* Make directory alias for is_dir

* Update tests to use proper jinja test syntax

* Update additional documentation, living outside of YAML files, to reflect proper jinja test syntax

* Add conversion script, porting guide updates, and changelog updates

* Update newly added uses of tests as filters

* No underscore variable

* Convert recent tests as filter changes to win_stat

* Fix some changes related to rebasing a few integration tests

* Make tests_as_filters_warning explicitly accept the name of the test, instead of inferring the name

* Add test for tests_as_filters_warning

* Update tests as filters in newly added/modified tests

* Address recent changes to several integration tests

* Address recent changes in cs_vpc
2017-11-27 17:58:08 -05:00

177 lines
4.6 KiB
YAML

---
- name: setup instance
cs_instance:
name: "{{ cs_resource_prefix }}-vm-snapshot-policy"
template: "{{ cs_common_template }}"
service_offering: "{{ cs_common_service_offering }}"
zone: "{{ cs_common_zone_adv }}"
register: instance
- name: verify setup instance
assert:
that:
- instance is successful
- name: setup snapshot policy absent
cs_snapshot_policy:
vm: "{{ cs_resource_prefix }}-vm-snapshot-policy"
interval_type: hourly
state: absent
register: snapshot
- name: verify setup snapshot policy absent
assert:
that:
- snapshot is successful
- name: create snapshot policy in check mode
cs_snapshot_policy:
vm: "{{ cs_resource_prefix }}-vm-snapshot-policy"
interval_type: hourly
schedule: 5
check_mode: true
register: snapshot
- name: verify create snapshot policy in check mode
assert:
that:
- snapshot is changed
- name: create snapshot policy
cs_snapshot_policy:
vm: "{{ cs_resource_prefix }}-vm-snapshot-policy"
interval_type: hourly
schedule: 5
register: snapshot
- name: verify create snapshot policy
assert:
that:
- snapshot is changed
- snapshot.schedule == "5"
- snapshot.interval_type == "hourly"
- snapshot.volume != ""
- name: create snapshot policy idempotence
cs_snapshot_policy:
vm: "{{ cs_resource_prefix }}-vm-snapshot-policy"
interval_type: hourly
schedule: 5
register: snapshot
- name: verify create snapshot policy idempotence
assert:
that:
- snapshot is not changed
- snapshot.schedule == "5"
- snapshot.interval_type == "hourly"
- snapshot.volume != ""
- name: update snapshot policy
cs_snapshot_policy:
vm: "{{ cs_resource_prefix }}-vm-snapshot-policy"
interval_type: hourly
schedule: 6
check_mode: true
register: snapshot
- name: verify update snapshot policy
assert:
that:
- snapshot is changed
- snapshot.schedule == "5"
- snapshot.interval_type == "hourly"
- snapshot.volume != ""
- name: update snapshot policy in check mode
cs_snapshot_policy:
vm: "{{ cs_resource_prefix }}-vm-snapshot-policy"
interval_type: hourly
schedule: 6
max_snaps: 3
time_zone: "Europe/Zurich"
check_mode: true
register: snapshot
- name: verify update snapshot policy in check mode
assert:
that:
- snapshot is changed
- snapshot.schedule == "5"
- snapshot.interval_type == "hourly"
- snapshot.volume != ""
- snapshot.max_snaps == 8
- snapshot.time_zone == "UTC"
- name: update snapshot policy
cs_snapshot_policy:
vm: "{{ cs_resource_prefix }}-vm-snapshot-policy"
interval_type: hourly
schedule: 6
max_snaps: 3
time_zone: "Europe/Zurich"
register: snapshot
- name: verify update snapshot policy
assert:
that:
- snapshot is changed
- snapshot.schedule == "6"
- snapshot.interval_type == "hourly"
- snapshot.volume != ""
- snapshot.max_snaps == 3
- snapshot.time_zone == "Europe/Zurich"
- name: update snapshot policy idempotence
cs_snapshot_policy:
vm: "{{ cs_resource_prefix }}-vm-snapshot-policy"
interval_type: hourly
schedule: 6
max_snaps: 3
time_zone: "Europe/Zurich"
register: snapshot
- name: verify update snapshot policy idempotence
assert:
that:
- snapshot is not changed
- snapshot.schedule == "6"
- snapshot.interval_type == "hourly"
- snapshot.volume != ""
- snapshot.max_snaps == 3
- snapshot.time_zone == "Europe/Zurich"
- name: remove snapshot policy in check mode
cs_snapshot_policy:
vm: "{{ cs_resource_prefix }}-vm-snapshot-policy"
interval_type: hourly
state: absent
check_mode: true
register: snapshot
- name: verify remove snapshot policy in check mode
assert:
that:
- snapshot is changed
- snapshot.schedule == "6"
- snapshot.interval_type == "hourly"
- snapshot.volume != ""
- snapshot.max_snaps == 3
- snapshot.time_zone == "Europe/Zurich"
- name: remove snapshot policy
cs_snapshot_policy:
vm: "{{ cs_resource_prefix }}-vm-snapshot-policy"
interval_type: hourly
state: absent
register: snapshot
- name: verify remove snapshot policy
assert:
that:
- snapshot is changed
- snapshot.schedule == "6"
- snapshot.interval_type == "hourly"
- snapshot.volume != ""
- snapshot.max_snaps == 3
- snapshot.time_zone == "Europe/Zurich"
- name: remove snapshot policy idempotence
cs_snapshot_policy:
vm: "{{ cs_resource_prefix }}-vm-snapshot-policy"
interval_type: hourly
state: absent
register: snapshot
- name: verify remove snapshot policy idempotence
assert:
that:
- snapshot is not changed