Skip to content

Commit

Permalink
[feature] Patch ansible/awx_task image to side-step AWX #6692
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominique Quatravaux committed Apr 16, 2020
1 parent 41f20c4 commit 551cf9f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
20 changes: 20 additions & 0 deletions ansible/roles/awx-instance/tasks/k8s-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,23 @@
when: _awx_runner_buildconfig is changed
shell: "oc -n {{ awx_mgmt_build_namespace }} start-build {{ awx_runner_image_name }}"
delegate_to: localhost

- name: "Patch {{ awx_task_base_image_fullname }} into {{ awx_task_image_name }}"
register: _awx_task_buildconfig
openshift_imagestream:
tag: "{{ awx_version }}"
metadata:
name: "{{ awx_task_image_name }}"
namespace: "{{ ansible_oc_namespace }}"
dockerfile: |
FROM {{ awx_task_base_image_fullname }}
# https://github.com/ansible/awx/issues/6692#issuecomment-613451838
USER 0
RUN set -e -x; for playbook in /var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/playbooks/*_isolated.yml; do sed -i '/rsync_opts:/a \ \ \ \ \ \ \ \ \ \ -\ "--blocking-io"' $playbook; done
USER 1000
- name: "Rebuild {{ awx_task_image_name }} now"
when: _awx_task_buildconfig is changed
shell: "oc -n {{ awx_mgmt_build_namespace }} start-build {{ awx_task_image_name }}"
delegate_to: localhost
2 changes: 1 addition & 1 deletion ansible/roles/awx-instance/tasks/k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
mountPath: "/var/run/memcached"
#####################################################
- name: awx-task
image: "ansible/awx_task:{{ awx_version }}"
image: docker-registry.default.svc:5000/{{ ansible_oc_namespace }}/{{ awx_task_image_name }}:{{ awx_version }}
command:
- /usr/bin/launch_awx_task.sh
resources:
Expand Down
3 changes: 3 additions & 0 deletions ansible/roles/awx-instance/vars/k8s-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ awx_runner_base_image_name: ansible-runner
awx_runner_base_image_fullname: docker.io/ansible/ansible-runner:latest
awx_runner_image_name: "wp-ansible-runner"

awx_task_base_image_fullname: "docker.io/ansible/awx_task:{{ awx_version }}"
awx_task_image_name: "wp-awx-task"

awx_wpveritas_inventory: "{{ awx_wpveritas_inventories[ansible_oc_namespace] }}"
awx_wpveritas_inventories:
wwp: prod
Expand Down

0 comments on commit 551cf9f

Please sign in to comment.