Skip to content
Snippets Groups Projects
Commit c0bf2934 authored by Václav Bartoš's avatar Václav Bartoš
Browse files

don't fail if CentOS image already exists

If CentOS image exists, its creation is just skipped and the rest of the "buildimages" step can continue.
parent 0926febe
No related branches found
No related tags found
No related merge requests found
--- ---
- name: Check for CentOS image
docker_image_info:
name: "{{repo}}/centos:{{version}}{{suffix}}"
register: centosimg
- name: Assert CentOS image
assert:
that: centosimg.images | length == 0
fail_msg: "CentOS image already exists"
- name: Create etc tree in build directory - name: Create etc tree in build directory
file: file:
path: '{{ temp_root}}/{{ item.path }}' path: '{{ temp_root}}/{{ item.path }}'
......
...@@ -5,7 +5,17 @@ ...@@ -5,7 +5,17 @@
- "'CHANGE_ME' not in soctoolsproxy" - "'CHANGE_ME' not in soctoolsproxy"
fail_msg: "Review *all* settings in group_vars/all/main.yml" fail_msg: "Review *all* settings in group_vars/all/main.yml"
- include: centos.yml
# Create CentOS image if not created yet
- name: Check for CentOS image
docker_image_info:
name: "{{repo}}/centos:{{version}}{{suffix}}"
register: centosimg
- name: Include tasks to create CentOS image
include_tasks: centos.yml
when: centosimg.images | length == 0
- name: Create main build dir - name: Create main build dir
file: file:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment