You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/legacy/roles/cloudscale_floating_ip/tasks/floating_ip.yml

95 lines
2.7 KiB
YAML

- name: Request floating IP
cloudscale_floating_ip:
server: '{{ test01.uuid }}'
ip_version: '{{ item.ip_version }}'
reverse_ptr: '{{ item.reverse_ptr | default(omit) }}'
prefix_length: '{{ item.prefix_length | default(omit) }}'
register: floating_ip
- name: Verify request floating IP
assert:
that:
- floating_ip is successful
- floating_ip is changed
- (item.ip_version == 4 and floating_ip.ip | ipv4) or (item.ip_version == 6 and floating_ip.ip | ipv6)
- floating_ip.server == test01.uuid
- name: Check floating IP indempotence
cloudscale_floating_ip:
server: '{{ test01.uuid }}'
ip: '{{ floating_ip.ip }}'
register: floating_ip_indempotence
- name: Verify floating IP indempotence
assert:
that:
- floating_ip_indempotence is successful
- floating_ip_indempotence is not changed
- floating_ip_indempotence.server == test01.uuid
- name: Check network parameter alias
cloudscale_floating_ip:
server: '{{ test01.uuid }}'
network: '{{ floating_ip.ip }}'
register: floating_ip_network
- name: Verify network parameter alias
assert:
that:
- floating_ip_network is successful
- name: Move floating IP to second server
cloudscale_floating_ip:
server: '{{ test02.uuid }}'
ip: '{{ floating_ip.ip }}'
register: move_ip
- name: Verify move floating IPv4 to second server
assert:
that:
- move_ip is successful
- move_ip is changed
- move_ip.server == test02.uuid
- name: Fail if server is missing on update
cloudscale_floating_ip:
ip: '{{ floating_ip.ip }}'
register: update_failed
ignore_errors: True
- name: Verify fail if server is missing on update
assert:
that:
- update_failed is failed
- "'Missing required parameter' in update_failed.msg"
- name: Release floating IP
cloudscale_floating_ip:
ip: '{{ floating_ip.ip }}'
state: 'absent'
register: release_ip
- name: Verify release floating IPs
assert:
that:
- release_ip is successful
- release_ip is changed
- release_ip.state == 'absent'
- name: Release floating IP indempotence
cloudscale_floating_ip:
ip: '{{ floating_ip.ip }}'
state: 'absent'
register: release_ip
- name: Verify release floating IPs indempotence
assert:
that:
- release_ip is successful
- release_ip is not changed
- release_ip.state == 'absent'
- name: Fail if server is missing on request
cloudscale_floating_ip:
ip_version: 6
register: request_failed
ignore_errors: True
- name: Verify fail if server is missing on request
assert:
that:
- request_failed is failed
- "'Missing required parameter' in request_failed.msg"