summaryrefslogtreecommitdiffstats
path: root/lib/ansible
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2018-10-26 14:03:17 -0400
committerTim Rozet <trozet@redhat.com>2018-11-01 08:46:58 -0400
commitd38e8a91c1a0e3f94d2a19876956ade48d1a8ed2 (patch)
tree9fa6ea0446ad7341e67d1b5ed2c0cf352db219e5 /lib/ansible
parentf20730a6633a9f910a804d5205fbdbff17e622d0 (diff)
Fixes Docker image upload for master/rocky
The API has changed to create/upload the docker container images to be used for deployment. In the past the prepare commands would read the THT environment files passed, to determine which docker images to render into an environment file. The new behavior uses a new "containers-prepare-parameter.yaml" format (included in this patch), which Apex will now configure for deployment. By default docker images will be rendered for all TripleO services identified in the roles_data.yaml file. Therefore we must use several excludes patterns to only pull the docker images needed for a default deployment. JIRA: APEX-642 Change-Id: Iab00fcb874554bb98540dc9a4c3051e58ea68a3b Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'lib/ansible')
-rw-r--r--lib/ansible/playbooks/configure_undercloud.yml7
-rw-r--r--lib/ansible/playbooks/prepare_overcloud_containers.yml51
2 files changed, 12 insertions, 46 deletions
diff --git a/lib/ansible/playbooks/configure_undercloud.yml b/lib/ansible/playbooks/configure_undercloud.yml
index 5e11ea9f..45d18e46 100644
--- a/lib/ansible/playbooks/configure_undercloud.yml
+++ b/lib/ansible/playbooks/configure_undercloud.yml
@@ -27,6 +27,13 @@
with_items:
- controller
- compute
+ - name: Copy container prep env file to undercloud
+ copy:
+ src: "{{ apex_temp_dir }}/containers-prepare-parameter.yaml"
+ dest: "/home/stack/containers-prepare-parameter.yaml"
+ owner: stack
+ group: stack
+ mode: 0644
- lineinfile:
path: /etc/sudoers
regexp: 'Defaults\s*requiretty'
diff --git a/lib/ansible/playbooks/prepare_overcloud_containers.yml b/lib/ansible/playbooks/prepare_overcloud_containers.yml
index 54dbe098..e2a4e134 100644
--- a/lib/ansible/playbooks/prepare_overcloud_containers.yml
+++ b/lib/ansible/playbooks/prepare_overcloud_containers.yml
@@ -20,49 +20,9 @@
when: patched_docker_services|length > 0
- name: Prepare generic docker registry image file
shell: >
- {{ stackrc }} && openstack overcloud container image prepare
- --namespace docker.io/tripleo{{ os_version }}
- --tag {{ container_tag }}
- --push-destination {{ undercloud_ip }}:8787
- -e /usr/share/openstack-tripleo-heat-templates/environments/docker.yaml
- -e /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml
- --output-images-file overcloud_containers.yml
+ sudo openstack tripleo container image prepare
+ -e /home/stack/containers-prepare-parameter.yaml
--output-env-file docker-images.yaml
- become: yes
- become_user: stack
- - name: Prepare SDN docker registry image file
- shell: >
- {{ stackrc }} && openstack overcloud container image prepare
- --namespace docker.io/tripleo{{ os_version }}
- --tag {{ container_tag }}
- --push-destination {{ undercloud_ip }}:8787
- {{ sdn_env_file }}
- --output-images-file sdn_containers.yml
- --output-env-file sdn-images.yaml
- become: yes
- become_user: stack
- when: sdn != false
- - name: Update Ceph tag for aarch64 in container env file
- lineinfile:
- path: /home/stack/overcloud_containers.yml
- regexp: '.*ceph.*'
- line: '- imagename: docker.io/ceph/daemon:master-fafda7d-luminous-centos-7-aarch64'
- when: aarch64
- - name: Update Ceph tag for aarch64 in container image file
- lineinfile:
- path: /home/stack/docker-images.yaml
- regexp: '^DockerCephDaemonImage'
- line: 'DockerCephDaemonImage: {{ undercloud_ip }}:8787/ceph/daemon/master-fafda7d-luminous-centos-7-aarch64'
- when: aarch64
- - name: Upload docker images to local registry
- shell: >
- {{ stackrc }} && openstack overcloud container image upload
- --config-file /home/stack/overcloud_containers.yml
- - name: Upload SDN docker images to local registry
- shell: >
- {{ stackrc }} && openstack overcloud container image upload
- --config-file /home/stack/sdn_containers.yml
- when: sdn != false
- name: Collect docker images in registry
uri:
url: http://{{ undercloud_ip }}:8787/v2/_catalog
@@ -84,9 +44,8 @@
with_items: "{{ patched_docker_services }}"
- name: Modify Images with Apex tag
replace:
- path: "{{ item[0] }}"
+ path: "/home/stack/docker-images.yaml"
regexp: "(\\s*Docker.*?:.*?centos-binary-{{ item[1] }}):.*"
replace: '\1:apex'
- with_nested:
- - [ '/home/stack/sdn-images.yaml', '/home/stack/docker-images.yaml']
- - "{{ patched_docker_services }}" \ No newline at end of file
+ with_items: "{{ patched_docker_services }}"
+ become: yes