Explicitly run image_build and image_push on localhost

This commit is contained in:
Shane McDonald
2020-12-26 13:10:28 -05:00
parent ab6430e50d
commit 1033c4d251
3 changed files with 1 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
--- ---
- name: Build AWX Docker Images - name: Build AWX Docker Images
hosts: all hosts: localhost
gather_facts: true gather_facts: true
roles: roles:
- {role: image_build} - {role: image_build}

View File

@@ -7,7 +7,6 @@
- name: Verify awx-logos directory exists for official install - name: Verify awx-logos directory exists for official install
stat: stat:
path: "../../awx-logos" path: "../../awx-logos"
delegate_to: localhost
register: logosdir register: logosdir
failed_when: logosdir.stat.isdir is not defined or not logosdir.stat.isdir failed_when: logosdir.stat.isdir is not defined or not logosdir.stat.isdir
when: awx_official|default(false)|bool when: awx_official|default(false)|bool
@@ -16,7 +15,6 @@
copy: copy:
src: "../../awx-logos/awx/ui/client/assets/" src: "../../awx-logos/awx/ui/client/assets/"
dest: "../awx/ui_next/public/static/media/" dest: "../awx/ui_next/public/static/media/"
delegate_to: localhost
when: awx_official|default(false)|bool when: awx_official|default(false)|bool
- name: Set awx image name - name: Set awx image name
@@ -27,16 +25,13 @@
template: template:
src: Dockerfile.j2 src: Dockerfile.j2
dest: ../Dockerfile dest: ../Dockerfile
delegate_to: localhost
# Calling Docker directly because docker-py doesnt support BuildKit # Calling Docker directly because docker-py doesnt support BuildKit
- name: Build AWX image - name: Build AWX image
command: docker build -t {{ awx_image }}:{{ awx_version }} .. command: docker build -t {{ awx_image }}:{{ awx_version }} ..
delegate_to: localhost
when: use_container_for_build|default(true)|bool when: use_container_for_build|default(true)|bool
- name: Tag awx images as latest - name: Tag awx images as latest
command: "docker tag {{ item }}:{{ awx_version }} {{ item }}:latest" command: "docker tag {{ item }}:{{ awx_version }} {{ item }}:latest"
delegate_to: localhost
with_items: with_items:
- "{{ awx_image }}" - "{{ awx_image }}"

View File

@@ -6,7 +6,6 @@
password: "{{ docker_registry_password }}" password: "{{ docker_registry_password }}"
reauthorize: true reauthorize: true
when: docker_registry is defined and docker_registry_password is defined when: docker_registry is defined and docker_registry_password is defined
delegate_to: localhost
- name: Remove local images to ensure proper push behavior - name: Remove local images to ensure proper push behavior
block: block:
@@ -15,7 +14,6 @@
name: "{{ docker_registry }}/{{ docker_registry_repository }}/{{ awx_image }}" name: "{{ docker_registry }}/{{ docker_registry_repository }}/{{ awx_image }}"
tag: "{{ awx_version }}" tag: "{{ awx_version }}"
state: absent state: absent
delegate_to: localhost
- name: Tag and Push Container Images - name: Tag and Push Container Images
block: block:
@@ -28,7 +26,6 @@
with_items: with_items:
- "latest" - "latest"
- "{{ awx_version }}" - "{{ awx_version }}"
delegate_to: localhost
- name: Set full image path for Registry - name: Set full image path for Registry
set_fact: set_fact: