--- - name: Create volume openstack.cloud.volume: cloud: "{{ cloud }}" state: present size: 1 name: ansible_volume description: Test volume register: vol - assert: that: item in vol.volume loop: "{{ expected_fields }}" - assert: that: not vol.volume.is_bootable - name: Create bootable volume from existing volume openstack.cloud.volume: cloud: "{{ cloud }}" state: present size: 1 volume: "{{ vol.volume.id }}" name: ansible_volume1 is_bootable: true description: Test volume register: vol - assert: that: vol.volume.is_bootable - name: Make the first volume bootable openstack.cloud.volume: cloud: "{{ cloud }}" state: present size: 1 name: ansible_volume is_bootable: true description: Test volume register: vol - assert: that: vol.volume.is_bootable - name: Delete volume openstack.cloud.volume: cloud: "{{ cloud }}" state: absent name: ansible_volume1 - name: Delete volume openstack.cloud.volume: cloud: "{{ cloud }}" state: absent name: ansible_volume - name: Test images block: - name: Ensure clean environment ansible.builtin.set_fact: tmp_file: !!null - name: Create a test image file ansible.builtin.tempfile: register: tmp_file - name: Fill test image file to 1MB community.general.filesize: path: '{{ tmp_file.path }}' size: 1M - name: Create test image openstack.cloud.image: cloud: "{{ cloud }}" state: present name: "{{ test_volume_image }}" filename: "{{ tmp_file.path }}" disk_format: raw - name: Create volume from image openstack.cloud.volume: cloud: "{{ cloud }}" state: present size: 1 image: "{{ test_volume_image }}" name: ansible_volume2 description: Test volume - name: Delete volume from image openstack.cloud.volume: cloud: "{{ cloud }}" name: ansible_volume2 state: absent - name: Create test shared image openstack.cloud.image: cloud: "{{ cloud }}" state: present name: ansible_image filename: "{{ tmp_file.path }}" is_public: true disk_format: raw - name: Delete test shared image openstack.cloud.image: cloud: "{{ cloud }}" state: absent name: ansible_image filename: "{{ tmp_file.path }}" is_public: true disk_format: raw always: - name: Remove temporary image file ansible.builtin.file: path: "{{ tmp_file.path }}" state: absent when: tmp_file is defined and 'path' in tmp_file - include_tasks: volume_info.yml