From 2a7d3bf2b5a2cc1f08ac4806d8c5559a03599132 Mon Sep 17 00:00:00 2001 From: matoval Date: Mon, 12 Jun 2023 10:42:02 -0700 Subject: [PATCH 1/3] Add builder_image_path var that is returned at end of builder role --- roles/builder/README.md | 6 +++++- roles/builder/tasks/main.yml | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/roles/builder/README.md b/roles/builder/README.md index a0de86e4..1f98463d 100644 --- a/roles/builder/README.md +++ b/roles/builder/README.md @@ -392,7 +392,11 @@ builder_set_variables: "{% raw %}{ipaddress: {{ ansible_all_ipv4_addresses }}, m ## Variables Exported by the Role -None. +### builder_image_path + +Type: string + +Returns the path where the newly built image is located. ## Dependencies diff --git a/roles/builder/tasks/main.yml b/roles/builder/tasks/main.yml index 35d031f6..ba189149 100644 --- a/roles/builder/tasks/main.yml +++ b/roles/builder/tasks/main.yml @@ -301,3 +301,7 @@ mode: '0644' owner: apache group: apache + +- name: Set var to image path + ansible.builtin.set_fact: + builder_image_path: "/var/www/html/{{ builder_blueprint_name }}/images/{{ builder_blueprint_output['current_version'] }}/{{ builder_blueprint_name }}_{{ builder_compose_type }}.{{ builder_compose_start_out['result']['output_type'] }}" # yamllint disable-line rule:line-length \ No newline at end of file From f5503c84160c62ae8b0f86b3db30ddf119c67bf9 Mon Sep 17 00:00:00 2001 From: matoval Date: Mon, 12 Jun 2023 10:45:39 -0700 Subject: [PATCH 2/3] lint --- roles/builder/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/builder/tasks/main.yml b/roles/builder/tasks/main.yml index ba189149..64cc647f 100644 --- a/roles/builder/tasks/main.yml +++ b/roles/builder/tasks/main.yml @@ -304,4 +304,4 @@ - name: Set var to image path ansible.builtin.set_fact: - builder_image_path: "/var/www/html/{{ builder_blueprint_name }}/images/{{ builder_blueprint_output['current_version'] }}/{{ builder_blueprint_name }}_{{ builder_compose_type }}.{{ builder_compose_start_out['result']['output_type'] }}" # yamllint disable-line rule:line-length \ No newline at end of file + builder_image_path: "/var/www/html/{{ builder_blueprint_name }}/images/{{ builder_blueprint_output['current_version'] }}/{{ builder_blueprint_name }}_{{ builder_compose_type }}.{{ builder_compose_start_out['result']['output_type'] }}" # yamllint disable-line rule:line-length From 5dc273a8e393581fad70ee847d12618f3f996cfb Mon Sep 17 00:00:00 2001 From: matoval Date: Mon, 12 Jun 2023 11:06:09 -0700 Subject: [PATCH 3/3] Fix issue for non installers --- roles/builder/tasks/main.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/roles/builder/tasks/main.yml b/roles/builder/tasks/main.yml index 64cc647f..fc90d690 100644 --- a/roles/builder/tasks/main.yml +++ b/roles/builder/tasks/main.yml @@ -182,6 +182,9 @@ mode: '0644' owner: apache group: apache + - name: Set var to image path + ansible.builtin.set_fact: + builder_image_path: "/var/www/html/{{ builder_blueprint_name }}/images/{{ builder_blueprint_output['current_version'] }}/{{ builder_blueprint_name }}_{{ _builder_compose_type }}.{{ builder_compose_start_out['result']['output_type'] }}" # yamllint disable-line rule:line-length - name: Restore context on blueprint directory ansible.builtin.command: "restorecon -R /var/www/html/{{ builder_blueprint_name }}" changed_when: true @@ -302,6 +305,6 @@ owner: apache group: apache -- name: Set var to image path - ansible.builtin.set_fact: - builder_image_path: "/var/www/html/{{ builder_blueprint_name }}/images/{{ builder_blueprint_output['current_version'] }}/{{ builder_blueprint_name }}_{{ builder_compose_type }}.{{ builder_compose_start_out['result']['output_type'] }}" # yamllint disable-line rule:line-length + - name: Set var to image path + ansible.builtin.set_fact: + builder_image_path: "/var/www/html/{{ builder_blueprint_name }}/images/{{ builder_blueprint_output['current_version'] }}/{{ builder_blueprint_name }}_{{ builder_compose_type }}.{{ builder_compose_start_out['result']['output_type'] }}" # yamllint disable-line rule:line-length