diff options
author | Monty Taylor <mordred@inaugust.com> | 2017-11-05 13:24:37 +1100 |
---|---|---|
committer | Monty Taylor <mordred@inaugust.com> | 2017-11-05 17:07:06 +1100 |
commit | 4ac60cf090af9618bd52b4b30cac4ee31b5d5967 (patch) | |
tree | 7dda33747456c3b806d25c4318bef9b717f8aa3e /src/three-minute-demo/roles/build-image/tasks/main.yaml | |
parent | 2f5dfc495113c6dadf66fc7d5d395f90118514ca (diff) |
Add ansible playbooks for 3 minute multi-cloud demo
Diffstat (limited to 'src/three-minute-demo/roles/build-image/tasks/main.yaml')
-rw-r--r-- | src/three-minute-demo/roles/build-image/tasks/main.yaml | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/three-minute-demo/roles/build-image/tasks/main.yaml b/src/three-minute-demo/roles/build-image/tasks/main.yaml new file mode 100644 index 0000000..57be287 --- /dev/null +++ b/src/three-minute-demo/roles/build-image/tasks/main.yaml | |||
@@ -0,0 +1,19 @@ | |||
1 | - block: | ||
2 | |||
3 | - name: Check for existing image | ||
4 | stat: | ||
5 | path: "{{ distro }}.{{ image_formats[0] }}" | ||
6 | register: image_file | ||
7 | |||
8 | - name: Build image | ||
9 | command: | | ||
10 | disk-image-create -o {{ distro }} -t {{ image_formats | join(',') }} {{ distro }}-minimal simple-init growroot | ||
11 | when: not image_file.stat.exists | ||
12 | |||
13 | - rescue: | ||
14 | |||
15 | - name: Clean up after a build failure | ||
16 | file: | ||
17 | path: "{{ distro }}.{{ item }}" | ||
18 | state: absent | ||
19 | with_items: "{{ image_formats }}" | ||