summaryrefslogtreecommitdiffstats
path: root/lib/ansible/playbooks/prepare_overcloud_containers.yml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ansible/playbooks/prepare_overcloud_containers.yml')
-rw-r--r--lib/ansible/playbooks/prepare_overcloud_containers.yml50
1 files changed, 50 insertions, 0 deletions
diff --git a/lib/ansible/playbooks/prepare_overcloud_containers.yml b/lib/ansible/playbooks/prepare_overcloud_containers.yml
new file mode 100644
index 0000000..ebf081d
--- /dev/null
+++ b/lib/ansible/playbooks/prepare_overcloud_containers.yml
@@ -0,0 +1,50 @@
+---
+- hosts: all
+ tasks:
+ - name: Upload container patches archive
+ copy:
+ src: "{{ apex_temp_dir }}/docker_patches.tar.gz"
+ dest: "/home/stack/docker_patches.tar.gz"
+ owner: stack
+ group: stack
+ mode: 0644
+ when: patched_docker_services|length > 0
+ - name: Unpack container patches archive
+ unarchive:
+ src: /home/stack/docker_patches.tar.gz
+ remote_src: yes
+ list_files: yes
+ group: stack
+ owner: stack
+ dest: /home/stack/
+ when: patched_docker_services|length > 0
+ - name: Prepare generic docker registry image file
+ shell: >
+ sudo openstack tripleo container image prepare
+ -e /home/stack/containers-prepare-parameter.yaml
+ --output-env-file docker-images.yaml
+ - name: Collect docker images in registry
+ uri:
+ url: http://{{ undercloud_ip }}:8787/v2/_catalog
+ body_format: json
+ register: response
+ - include_tasks: patch_containers.yml
+ with_items: "{{ patched_docker_services }}"
+ loop_control:
+ loop_var: item
+ when:
+ - patched_docker_services|length > 0
+ - item in (response.json)['repositories']|join(" ")
+ - name: Push patched docker images to local registry
+ shell: "{{ container_client }} push {{ undercloud_ip }}:8787/tripleo{{ os_version }}/centos-binary-{{ item }}:apex"
+ when:
+ - patched_docker_services|length > 0
+ - item in (response.json)['repositories']|join(" ")
+ with_items: "{{ patched_docker_services }}"
+ - name: Modify Images with Apex tag
+ replace:
+ path: "/home/stack/docker-images.yaml"
+ regexp: "(\\s*Docker.*?:.*?centos-binary-{{ item }}):.*"
+ replace: '\1:apex'
+ with_items: "{{ patched_docker_services }}"
+ become: yes