File: main.yml

package info (click to toggle)
python-openstacksdk 4.7.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,904 kB
  • sloc: python: 127,036; sh: 153; makefile: 23
file content (54 lines) | stat: -rw-r--r-- 1,129 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
- name: Create a test image file
  shell: mktemp
  register: tmp_file

- name: Fill test image file to 1MB
  shell: truncate -s 1048576 {{ tmp_file.stdout }}

- name: Create raw image (defaults)
  os_image:
     cloud: "{{ cloud }}"
     state: present
     name: "{{ image_name }}"
     filename: "{{ tmp_file.stdout }}"
     disk_format: raw
  register: image

- debug: var=image

- name: Delete raw image (defaults)
  os_image:
     cloud: "{{ cloud }}"
     state: absent
     name: "{{ image_name }}"

- name: Create raw image (complex)
  os_image:
     cloud: "{{ cloud }}"
     state: present
     name: "{{ image_name }}"
     filename: "{{ tmp_file.stdout }}"
     disk_format: raw
     is_public: True
     min_disk: 10
     min_ram: 1024
     kernel: cirros-vmlinuz
     ramdisk: cirros-initrd
     properties:
        cpu_arch: x86_64
        distro: ubuntu
  register: image

- debug: var=image

- name: Delete raw image (complex)
  os_image:
     cloud: "{{ cloud }}"
     state: absent
     name: "{{ image_name }}"

- name: Delete test image file
  file:
     name: "{{ tmp_file.stdout }}"
     state: absent