From aa3e83ab723b7da5019b6f7fb715ceff94eda919 Mon Sep 17 00:00:00 2001 From: Andrii Ostapenko Date: Sun, 28 Feb 2021 17:25:53 -0600 Subject: [PATCH] Allow to run role passed from variable Change-Id: Icf47ee108dcfcb9792f83d16a5d6bdbcd70eb22f Signed-off-by: Andrii Ostapenko --- playbooks/airship-images-build.yaml | 6 +++++- playbooks/airship-images-publish.yaml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/playbooks/airship-images-build.yaml b/playbooks/airship-images-build.yaml index 87b07c4..d6a058a 100644 --- a/playbooks/airship-images-build.yaml +++ b/playbooks/airship-images-build.yaml @@ -32,6 +32,10 @@ pip: name: docker executable: pip3 + - name: Execute custom role + include_role: + name: "{{ pre_build_role }}" + when: pre_build_role is defined - name: Publish images block: - make: @@ -43,7 +47,7 @@ DOCKER_REGISTRY: "{{ docker_registry }}" GCP_SDK: "{{ gcp_sdk }}" IMAGE_PREFIX: "{{ image_prefix | default('airshipit') }}" - IMAGE_TAG: "{{ image_tag | default(zuul.image_tag) | default('latest') }}" + IMAGE_TAG: "{{ image_tag | default('latest') }}" LABEL: "{{ image_label | default('org.airshipit.build=community') }}" NO_PROXY: "{{ proxy.noproxy }}" PUSH_IMAGE: "false" diff --git a/playbooks/airship-images-publish.yaml b/playbooks/airship-images-publish.yaml index 6a2ab0a..5c6d79e 100644 --- a/playbooks/airship-images-publish.yaml +++ b/playbooks/airship-images-publish.yaml @@ -32,6 +32,10 @@ pip: name: docker executable: pip3 + - name: Execute custom role + include_role: + name: "{{ pre_build_role }}" + when: pre_build_role is defined - name: Publish images block: - docker_login: @@ -47,7 +51,7 @@ DOCKER_REGISTRY: "{{ docker_registry }}" GCP_SDK: "{{ gcp_sdk }}" IMAGE_PREFIX: "{{ image_prefix | default('airshipit') }}" - IMAGE_TAG: "{{ image_tag | default(zuul.image_tag) | default('latest') }}" + IMAGE_TAG: "{{ image_tag | default('latest') }}" LABEL: "{{ image_label | default('org.airshipit.build=community') }}" NO_PROXY: "{{ proxy.noproxy }}" PUSH_IMAGE: "true"