Shane McDonald c9b53cf975
Refactor image_build and image_push roles
Primary changes are:

- Generalized variable names (remove "docker")
- Add explicit "push" variable rather than checking if the "registry" variable is defined.
- Allow for passing in version as build arg
2021-10-12 18:59:13 -04:00

23 lines
594 B
YAML

---
- name: Authenticate with Docker registry if registry password given
docker_login:
registry: "{{ registry }}"
username: "{{ registry_username }}"
password: "{{ registry_password }}"
reauthorize: true
when:
- registry is defined
- registry_username is defined
- registry_password is defined
- name: Tag and Push Container Images
docker_image:
name: "{{ awx_image }}:{{ awx_version }}"
repository: "{{ registry }}/{{ awx_image }}:{{ item }}"
force_tag: yes
push: true
source: local
with_items:
- "latest"
- "{{ awx_version }}"