summaryrefslogtreecommitdiffstats
path: root/lib/ansible/playbooks/patch_containers.yml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ansible/playbooks/patch_containers.yml')
-rw-r--r--lib/ansible/playbooks/patch_containers.yml13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/ansible/playbooks/patch_containers.yml b/lib/ansible/playbooks/patch_containers.yml
new file mode 100644
index 0000000..1ef0581
--- /dev/null
+++ b/lib/ansible/playbooks/patch_containers.yml
@@ -0,0 +1,13 @@
+---
+ - name: "Pull docker image to ensure it exists locally: {{ item }}"
+ shell: "{{ container_client }} pull {{ undercloud_ip }}:8787/tripleo{{ os_version }}/centos-binary-{{ item }}:current-tripleo"
+ - name: "Find docker image user {{ item }}"
+ shell: >
+ {{ container_client }} inspect --format='{{ '{{' }}.ContainerConfig.User{{ '}}' }}'
+ {{ undercloud_ip }}:8787/tripleo{{ os_version }}/centos-binary-{{ item }}:current-tripleo
+ register: user_result
+ - name: "Patch docker image {{ item }}"
+ shell: >
+ cd /home/stack/containers/{{ item }} && {{ container_client }} build
+ --build-arg REAL_USER={{ user_result.stdout }}
+ -t {{ undercloud_ip }}:8787/tripleo{{ os_version }}/centos-binary-{{ item }}:apex .