mirror of
https://github.com/ansible/awx.git
synced 2026-05-23 16:47:45 -02:30
Modify openshift roles to support official AWX images
This commit is contained in:
@@ -24,26 +24,30 @@
|
||||
- awx_node_port is defined and awx_node_port != ''
|
||||
msg: "Set the value of 'awx_node_port' in the inventory file."
|
||||
|
||||
- name: docker_registry should be defined
|
||||
- name: docker_registry should be defined if not using dockerhub
|
||||
assert:
|
||||
that:
|
||||
- docker_registry is defined and docker_registry != ''
|
||||
msg: "Set the value of 'docker_registry' in the inventory file."
|
||||
when: dockerhub_base is not defined
|
||||
|
||||
- name: docker_registry_repository should be defined
|
||||
- name: docker_registry_repository should be defined if not using dockerhub
|
||||
assert:
|
||||
that:
|
||||
- docker_registry_repository is defined and docker_registry_repository != ''
|
||||
msg: "Set the value of 'docker_registry_repository' in the inventory file."
|
||||
when: dockerhub_base is not defined
|
||||
|
||||
- name: docker_registry_username should be defined
|
||||
- name: docker_registry_username should be defined if not using dockerhub
|
||||
assert:
|
||||
that:
|
||||
- docker_registry_username is defined and docker_registry_username != ''
|
||||
msg: "Set the value of 'docker_registry_username' in the inventory file."
|
||||
when: dockerhub_base is not defined
|
||||
|
||||
- name: docker_registry_password should be defined
|
||||
assert:
|
||||
that:
|
||||
- docker_registry_password is defined and docker_registry_password != ''
|
||||
msg: "Set the value of 'docker_registry_password' in the inventory file."
|
||||
when: dockerhub_base is not defined
|
||||
|
||||
@@ -30,9 +30,11 @@ awx_secret_key=awxsecret
|
||||
postgres_data_dir=/tmp/pgdocker
|
||||
host_port=80
|
||||
|
||||
# Required for Openshift (unless you use an external registry or DockerHub), Optional for Standalone Docker install
|
||||
# Define if you want the image pushed to a registry. The container definition
|
||||
# will also use these images
|
||||
# Required for Openshift when building the image on your own
|
||||
# Optional for Openshift if using Dockerhub or another prebuilt registry
|
||||
# Required for Standalone Docker Install if building the image on your own
|
||||
# Optional for Standalone Docker Install if using Dockerhub or another prebuilt registry
|
||||
# Define if you want the image pushed to a registry. The container definition will also use these images
|
||||
# docker_registry=172.30.1.1:5000
|
||||
# docker_registry_repository=awx
|
||||
# docker_registry_username=developer
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
- name: Mark Openshift User as Admin
|
||||
shell: "oc adm policy add-role-to-user admin {{ openshift_user }} -n {{ awx_openshift_project }}"
|
||||
|
||||
- name: Manage AWX Container Images
|
||||
block:
|
||||
- name: Get docker registry password from oc if needed
|
||||
block:
|
||||
- name: Set docker registry password
|
||||
@@ -66,16 +68,6 @@
|
||||
when: docker_registry is defined
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Deploy and Activate Postgres
|
||||
shell: "oc new-app --template=postgresql-persistent -e MEMORY_LIMIT={{ pg_memory_limit|default('512') }}Mi -e NAMESPACE=openshift -e DATABASE_SERVICE_NAME=postgresql -e POSTGRESQL_USER={{ pg_username }} -e POSTGRESQL_PASSWORD={{ pg_password }} -e POSTGRESQL_DATABASE={{ pg_database }} -e VOLUME_CAPACITY={{ pg_volume_capacity|default('5')}}Gi -e POSTGRESQL_VERSION=9.5 -n {{ awx_openshift_project }}"
|
||||
when: (pg_hostname is not defined or pg_hostname == '') and (postgres_svc_details is defined and postgres_svc_details.rc != 0)
|
||||
register: openshift_pg_activate
|
||||
|
||||
- name: Wait for Postgres to activate
|
||||
pause:
|
||||
seconds: 15
|
||||
when: openshift_pg_activate|changed
|
||||
|
||||
- name: Set full web image path
|
||||
set_fact:
|
||||
awx_web_openshift_image: "{{ docker_registry }}/{{ docker_registry_repository }}/{{ awx_web_image }}:{{ awx_version }}"
|
||||
@@ -85,6 +77,23 @@
|
||||
set_fact:
|
||||
awx_task_openshift_image: "{{ docker_registry }}/{{ docker_registry_repository }}/{{ awx_task_image }}:{{ awx_version }}"
|
||||
when: awx_task_openshift_image is not defined
|
||||
when: dockerhub_base is not defined
|
||||
|
||||
- name: Set DockerHub Image Paths
|
||||
set_fact:
|
||||
awx_web_openshift_image: "{{ dockerhub_base }}/awx_web:{{ dockerhub_version }}"
|
||||
awx_task_openshift_image: "{{ dockerhub_base }}/awx_task:{{ dockerhub_version }}"
|
||||
when: dockerhub_base is defined
|
||||
|
||||
- name: Deploy and Activate Postgres
|
||||
shell: "oc new-app --template=postgresql-persistent -e MEMORY_LIMIT={{ pg_memory_limit|default('512') }}Mi -e NAMESPACE=openshift -e DATABASE_SERVICE_NAME=postgresql -e POSTGRESQL_USER={{ pg_username }} -e POSTGRESQL_PASSWORD={{ pg_password }} -e POSTGRESQL_DATABASE={{ pg_database }} -e VOLUME_CAPACITY={{ pg_volume_capacity|default('5')}}Gi -e POSTGRESQL_VERSION=9.5 -n {{ awx_openshift_project }}"
|
||||
when: (pg_hostname is not defined or pg_hostname == '') and (postgres_svc_details is defined and postgres_svc_details.rc != 0)
|
||||
register: openshift_pg_activate
|
||||
|
||||
- name: Wait for Postgres to activate
|
||||
pause:
|
||||
seconds: 15
|
||||
when: openshift_pg_activate|changed
|
||||
|
||||
- name: Set openshift base path
|
||||
set_fact:
|
||||
|
||||
Reference in New Issue
Block a user