From 9eb38405b7bf5575957860ae1da91c31279bf06d Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Fri, 7 Oct 2016 15:42:38 -0300 Subject: [PATCH] ansible: swift: Fix swift-object-expirer restart loop The swift-object-expirer is provided by the 'openstack-swift-proxy' package and thus it is unavailable on swift-object image. This change adds a new Docker image to fulfill this requirement and stop using swift-object image in this case. This image is needed while RDO does not fix the packaging. The issue is being tracked in: https://bugzilla.redhat.com/show_bug.cgi?id=1382921 Change-Id: Idc7ee92d756d8923da2198ede33abf5ed1142041 Closes-Bug: 1630425 --- ansible/roles/swift/defaults/main.yml | 4 +++ ansible/roles/swift/tasks/start.yml | 2 +- .../swift/swift-object-expirer/Dockerfile.j2 | 25 +++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 docker/swift/swift-object-expirer/Dockerfile.j2 diff --git a/ansible/roles/swift/defaults/main.yml b/ansible/roles/swift/defaults/main.yml index 7171d87609..e10f8cda99 100644 --- a/ansible/roles/swift/defaults/main.yml +++ b/ansible/roles/swift/defaults/main.yml @@ -20,6 +20,10 @@ swift_object_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ do swift_object_tag: "{{ openstack_release }}" swift_object_image_full: "{{ swift_object_image }}:{{ swift_object_tag }}" +swift_object_expirer_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-object-expirer" +swift_object_expirer_tag: "{{ openstack_release }}" +swift_object_expirer_image_full: "{{ swift_object_expirer_image }}:{{ swift_object_expirer_tag }}" + swift_rsyncd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-rsyncd" swift_rsyncd_tag: "{{ openstack_release }}" swift_rsyncd_image_full: "{{ swift_rsyncd_image }}:{{ swift_rsyncd_tag }}" diff --git a/ansible/roles/swift/tasks/start.yml b/ansible/roles/swift/tasks/start.yml index 891f92ed76..39b08f174b 100644 --- a/ansible/roles/swift/tasks/start.yml +++ b/ansible/roles/swift/tasks/start.yml @@ -218,7 +218,7 @@ kolla_docker: action: "start_container" common_options: "{{ docker_common_options }}" - image: "{{ swift_object_image_full }}" + image: "{{ swift_object_expirer_image_full }}" name: "swift_object_expirer" volumes: - "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro" diff --git a/docker/swift/swift-object-expirer/Dockerfile.j2 b/docker/swift/swift-object-expirer/Dockerfile.j2 new file mode 100644 index 0000000000..e451aec44f --- /dev/null +++ b/docker/swift/swift-object-expirer/Dockerfile.j2 @@ -0,0 +1,25 @@ +FROM {{ namespace }}/{{ image_prefix }}swift-base:{{ tag }} +MAINTAINER {{ maintainer }} + +{% block swift_object_expirer_header %}{% endblock %} + +{% import "macros.j2" as macros with context %} + +{% if install_type == 'binary' %} + {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} + # RDO has it packaged in the wrong package for now. The issue is being + # tracked in https://bugzilla.redhat.com/show_bug.cgi?id=1382921 + {% set swift_object_expirer_packages = ['openstack-swift-proxy'] %} + {% elif base_distro in ['ubuntu'] %} + {% set swift_object_expirer_packages = ['swift-object'] %} + {% endif %} + +{{ macros.install_packages(swift_object_expirer_packages | customizable("packages")) }} + +{% endif %} + +{% block swift_object_expirer_footer %}{% endblock %} +{% block footer %}{% endblock %} +{{ include_footer }} + +USER swift