From 91fc423a01866df1354f1a0720e83a2c25b93572 Mon Sep 17 00:00:00 2001 From: jamesmmccarthy Date: Tue, 1 Sep 2015 08:32:00 +0000 Subject: [PATCH] Add missing Swift services, also ansible configuration DocImpact Closes-Bug: #1477993 Co-Authored-By: Paul Bourke Change-Id: Ifeab0fec11889cb0c90a56a6211dbdd27a40f3d9 --- ansible/roles/swift/defaults/main.yml | 24 ++ ansible/roles/swift/tasks/config.yml | 140 +++++++++++ ansible/roles/swift/tasks/start.yml | 230 ++++++++++++++++++ .../swift/templates/account-server.conf.j2 | 12 + .../swift/templates/container-server.conf.j2 | 12 + .../swift/templates/object-server.conf.j2 | 23 ++ .../swift/swift-account-auditor/Dockerfile.j2 | 19 ++ .../swift-account-auditor/config-external.sh | 19 ++ docker/swift/swift-account-auditor/start.sh | 14 ++ .../swift/swift-account-reaper/Dockerfile.j2 | 19 ++ .../swift-account-reaper/config-external.sh | 19 ++ docker/swift/swift-account-reaper/start.sh | 14 ++ .../swift-account-replicator/Dockerfile.j2 | 19 ++ .../config-external.sh | 19 ++ .../swift/swift-account-replicator/start.sh | 14 ++ .../swift-container-auditor/Dockerfile.j2 | 19 ++ .../config-external.sh | 21 ++ docker/swift/swift-container-auditor/start.sh | 14 ++ .../swift-container-replicator/Dockerfile.j2 | 19 ++ .../config-external.sh | 21 ++ .../swift/swift-container-replicator/start.sh | 14 ++ .../swift-container-updater/Dockerfile.j2 | 19 ++ .../config-external.sh | 27 ++ docker/swift/swift-container-updater/start.sh | 14 ++ .../swift-object-auditor/config-external.sh | 33 ++- docker/swift/swift-object-auditor/start.sh | 4 +- .../swift-object-expirer/config-external.sh | 39 ++- docker/swift/swift-object-expirer/start.sh | 4 +- .../config-external.sh | 33 ++- docker/swift/swift-object-replicator/start.sh | 4 +- .../swift-object-updater/config-external.sh | 33 ++- docker/swift/swift-object-updater/start.sh | 4 +- etc/kolla/config/swift/account-auditor.conf | 0 etc/kolla/config/swift/account-reaper.conf | 0 .../config/swift/account-replicator.conf | 0 etc/kolla/config/swift/container-auditor.conf | 0 .../config/swift/container-replicator.conf | 0 etc/kolla/config/swift/container-updater.conf | 0 etc/kolla/config/swift/object-auditor.conf | 0 etc/kolla/config/swift/object-expirer.conf | 0 etc/kolla/config/swift/object-replicator.conf | 0 etc/kolla/config/swift/object-updater.conf | 0 42 files changed, 859 insertions(+), 60 deletions(-) create mode 100644 docker/swift/swift-account-auditor/Dockerfile.j2 create mode 100644 docker/swift/swift-account-auditor/config-external.sh create mode 100755 docker/swift/swift-account-auditor/start.sh create mode 100644 docker/swift/swift-account-reaper/Dockerfile.j2 create mode 100644 docker/swift/swift-account-reaper/config-external.sh create mode 100755 docker/swift/swift-account-reaper/start.sh create mode 100644 docker/swift/swift-account-replicator/Dockerfile.j2 create mode 100644 docker/swift/swift-account-replicator/config-external.sh create mode 100755 docker/swift/swift-account-replicator/start.sh create mode 100644 docker/swift/swift-container-auditor/Dockerfile.j2 create mode 100644 docker/swift/swift-container-auditor/config-external.sh create mode 100755 docker/swift/swift-container-auditor/start.sh create mode 100644 docker/swift/swift-container-replicator/Dockerfile.j2 create mode 100644 docker/swift/swift-container-replicator/config-external.sh create mode 100755 docker/swift/swift-container-replicator/start.sh create mode 100644 docker/swift/swift-container-updater/Dockerfile.j2 create mode 100644 docker/swift/swift-container-updater/config-external.sh create mode 100755 docker/swift/swift-container-updater/start.sh create mode 100644 etc/kolla/config/swift/account-auditor.conf create mode 100644 etc/kolla/config/swift/account-reaper.conf create mode 100644 etc/kolla/config/swift/account-replicator.conf create mode 100644 etc/kolla/config/swift/container-auditor.conf create mode 100644 etc/kolla/config/swift/container-replicator.conf create mode 100644 etc/kolla/config/swift/container-updater.conf create mode 100644 etc/kolla/config/swift/object-auditor.conf create mode 100644 etc/kolla/config/swift/object-expirer.conf create mode 100644 etc/kolla/config/swift/object-replicator.conf create mode 100644 etc/kolla/config/swift/object-updater.conf diff --git a/ansible/roles/swift/defaults/main.yml b/ansible/roles/swift/defaults/main.yml index 6e156a8f39..962cbd4367 100644 --- a/ansible/roles/swift/defaults/main.yml +++ b/ansible/roles/swift/defaults/main.yml @@ -16,10 +16,34 @@ swift_account_server_image: "{{ docker_registry ~ '/' if docker_registry else '' swift_account_server_tag: "{{ openstack_release }}" swift_account_server_image_full: "{{ swift_account_server_image }}:{{ swift_account_server_tag }}" +swift_account_auditor_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-account-auditor" +swift_account_auditor_tag: "{{ openstack_release }}" +swift_account_auditor_image_full: "{{ swift_account_auditor_image }}:{{ swift_account_auditor_tag }}" + +swift_account_replicator_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-account-replicator" +swift_account_replicator_tag: "{{ openstack_release }}" +swift_account_replicator_image_full: "{{ swift_account_replicator_image }}:{{ swift_account_replicator_tag }}" + +swift_account_reaper_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-account-reaper" +swift_account_reaper_tag: "{{ openstack_release }}" +swift_account_reaper_image_full: "{{ swift_account_reaper_image }}:{{ swift_account_reaper_tag }}" + swift_container_server_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-container-server" swift_container_server_tag: "{{ openstack_release }}" swift_container_server_image_full: "{{ swift_container_server_image }}:{{ swift_container_server_tag }}" +swift_container_auditor_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-container-auditor" +swift_container_auditor_tag: "{{ openstack_release }}" +swift_container_auditor_image_full: "{{ swift_container_auditor_image }}:{{ swift_container_auditor_tag }}" + +swift_container_replicator_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-container-replicator" +swift_container_replicator_tag: "{{ openstack_release }}" +swift_container_replicator_image_full: "{{ swift_container_replicator_image }}:{{ swift_container_replicator_tag }}" + +swift_container_updater_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-container-updater" +swift_container_updater_tag: "{{ openstack_release }}" +swift_container_updater_image_full: "{{ swift_container_updater_image }}:{{ swift_container_updater_tag }}" + swift_object_auditor_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-object-auditor" swift_object_auditor_tag: "{{ openstack_release }}" swift_object_auditor_image_full: "{{ swift_object_auditor_image }}:{{ swift_object_auditor_tag }}" diff --git a/ansible/roles/swift/tasks/config.yml b/ansible/roles/swift/tasks/config.yml index b3ec2f1db7..8498c8df8d 100644 --- a/ansible/roles/swift/tasks/config.yml +++ b/ansible/roles/swift/tasks/config.yml @@ -42,6 +42,48 @@ config_dest: "{{ node_config_directory }}/{{ service_name }}/account-server.conf" when: inventory_hostname in groups['swift-account-server'] +- include: ../../config.yml + vars: + service_name: "swift-account-auditor" + config_source: + - "roles/swift/templates/account-server.conf.j2" + - "/etc/kolla/config/global.conf" + - "/etc/kolla/config/swift/account-auditor.conf" + config_template_dest: + - "{{ node_templates_directory }}/{{ service_name }}/account-auditor.conf_minimal" + - "{{ node_templates_directory }}/{{ service_name }}/account-auditor.conf_global" + - "{{ node_templates_directory }}/{{ service_name }}/account-auditor.conf_augment" + config_dest: "{{ node_config_directory }}/{{ service_name }}/account-auditor.conf" + when: inventory_hostname in groups['swift-account-server'] + +- include: ../../config.yml + vars: + service_name: "swift-account-replicator" + config_source: + - "roles/swift/templates/account-server.conf.j2" + - "/etc/kolla/config/global.conf" + - "/etc/kolla/config/swift/account-replicator.conf" + config_template_dest: + - "{{ node_templates_directory }}/{{ service_name }}/account-replicator.conf_minimal" + - "{{ node_templates_directory }}/{{ service_name }}/account-replicator.conf_global" + - "{{ node_templates_directory }}/{{ service_name }}/account-replicator.conf_augment" + config_dest: "{{ node_config_directory }}/{{ service_name }}/account-replicator.conf" + when: inventory_hostname in groups['swift-account-server'] + +- include: ../../config.yml + vars: + service_name: "swift-account-reaper" + config_source: + - "roles/swift/templates/account-server.conf.j2" + - "/etc/kolla/config/global.conf" + - "/etc/kolla/config/swift/account-reaper.conf" + config_template_dest: + - "{{ node_templates_directory }}/{{ service_name }}/account-reaper.conf_minimal" + - "{{ node_templates_directory }}/{{ service_name }}/account-reaper.conf_global" + - "{{ node_templates_directory }}/{{ service_name }}/account-reaper.conf_augment" + config_dest: "{{ node_config_directory }}/{{ service_name }}/account-reaper.conf" + when: inventory_hostname in groups['swift-account-server'] + - include: ../../config.yml vars: service_name: "swift-container-server" @@ -56,6 +98,48 @@ config_dest: "{{ node_config_directory }}/{{ service_name }}/container-server.conf" when: inventory_hostname in groups['swift-container-server'] +- include: ../../config.yml + vars: + service_name: "swift-container-auditor" + config_source: + - "roles/swift/templates/container-server.conf.j2" + - "/etc/kolla/config/global.conf" + - "/etc/kolla/config/swift/container-auditor.conf" + config_template_dest: + - "{{ node_templates_directory }}/{{ service_name }}/container-auditor.conf_minimal" + - "{{ node_templates_directory }}/{{ service_name }}/container-auditor.conf_global" + - "{{ node_templates_directory }}/{{ service_name }}/container-auditor.conf_augment" + config_dest: "{{ node_config_directory }}/{{ service_name }}/container-auditor.conf" + when: inventory_hostname in groups['swift-container-server'] + +- include: ../../config.yml + vars: + service_name: "swift-container-replicator" + config_source: + - "roles/swift/templates/container-server.conf.j2" + - "/etc/kolla/config/global.conf" + - "/etc/kolla/config/swift/container-replicator.conf" + config_template_dest: + - "{{ node_templates_directory }}/{{ service_name }}/container-replicator.conf_minimal" + - "{{ node_templates_directory }}/{{ service_name }}/container-replicator.conf_global" + - "{{ node_templates_directory }}/{{ service_name }}/container-replicator.conf_augment" + config_dest: "{{ node_config_directory }}/{{ service_name }}/container-replicator.conf" + when: inventory_hostname in groups['swift-container-server'] + +- include: ../../config.yml + vars: + service_name: "swift-container-updater" + config_source: + - "roles/swift/templates/container-server.conf.j2" + - "/etc/kolla/config/global.conf" + - "/etc/kolla/config/swift/container-updater.conf" + config_template_dest: + - "{{ node_templates_directory }}/{{ service_name }}/container-updater.conf_minimal" + - "{{ node_templates_directory }}/{{ service_name }}/container-updater.conf_global" + - "{{ node_templates_directory }}/{{ service_name }}/container-updater.conf_augment" + config_dest: "{{ node_config_directory }}/{{ service_name }}/container-updater.conf" + when: inventory_hostname in groups['swift-container-server'] + - include: ../../config.yml vars: service_name: "swift-object-server" @@ -70,6 +154,62 @@ config_dest: "{{ node_config_directory }}/{{ service_name }}/object-server.conf" when: inventory_hostname in groups['swift-object-server'] +- include: ../../config.yml + vars: + service_name: "swift-object-auditor" + config_source: + - "roles/swift/templates/object-server.conf.j2" + - "/etc/kolla/config/global.conf" + - "/etc/kolla/config/swift/object-auditor.conf" + config_template_dest: + - "{{ node_templates_directory }}/{{ service_name }}/object-auditor.conf_minimal" + - "{{ node_templates_directory }}/{{ service_name }}/object-auditor.conf_global" + - "{{ node_templates_directory }}/{{ service_name }}/object-auditor.conf_augment" + config_dest: "{{ node_config_directory }}/{{ service_name }}/object-auditor.conf" + when: inventory_hostname in groups['swift-object-server'] + +- include: ../../config.yml + vars: + service_name: "swift-object-replicator" + config_source: + - "roles/swift/templates/object-server.conf.j2" + - "/etc/kolla/config/global.conf" + - "/etc/kolla/config/swift/object-replicator.conf" + config_template_dest: + - "{{ node_templates_directory }}/{{ service_name }}/object-replicator.conf_minimal" + - "{{ node_templates_directory }}/{{ service_name }}/object-replicator.conf_global" + - "{{ node_templates_directory }}/{{ service_name }}/object-replicator.conf_augment" + config_dest: "{{ node_config_directory }}/{{ service_name }}/object-replicator.conf" + when: inventory_hostname in groups['swift-object-server'] + +- include: ../../config.yml + vars: + service_name: "swift-object-updater" + config_source: + - "roles/swift/templates/object-server.conf.j2" + - "/etc/kolla/config/global.conf" + - "/etc/kolla/config/swift/object-updater.conf" + config_template_dest: + - "{{ node_templates_directory }}/{{ service_name }}/object-updater.conf_minimal" + - "{{ node_templates_directory }}/{{ service_name }}/object-updater.conf_global" + - "{{ node_templates_directory }}/{{ service_name }}/object-updater.conf_augment" + config_dest: "{{ node_config_directory }}/{{ service_name }}/object-updater.conf" + when: inventory_hostname in groups['swift-object-server'] + +- include: ../../config.yml + vars: + service_name: "swift-object-expirer" + config_source: + - "roles/swift/templates/object-server.conf.j2" + - "/etc/kolla/config/global.conf" + - "/etc/kolla/config/swift/object-expirer.conf" + config_template_dest: + - "{{ node_templates_directory }}/{{ service_name }}/object-expirer.conf_minimal" + - "{{ node_templates_directory }}/{{ service_name }}/object-expirer.conf_global" + - "{{ node_templates_directory }}/{{ service_name }}/object-expirer.conf_augment" + config_dest: "{{ node_config_directory }}/{{ service_name }}/object-expirer.conf" + when: inventory_hostname in groups['swift-object-server'] + - name: Copying over Swift ring files copy: src: "{{ item.src }}" diff --git a/ansible/roles/swift/tasks/start.yml b/ansible/roles/swift/tasks/start.yml index eaf9c9a6cd..9699dece03 100644 --- a/ansible/roles/swift/tasks/start.yml +++ b/ansible/roles/swift/tasks/start.yml @@ -45,6 +45,75 @@ KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" when: inventory_hostname in groups['swift-account-server'] +- name: Starting Swift Account Auditor container + docker: + docker_api_version: "{{ docker_api_version }}" + net: host + pull: "{{ docker_pull_policy }}" + restart_policy: "{{ docker_restart_policy }}" + restart_policy_retry: "{{ docker_restart_policy_retry }}" + state: reloaded + registry: "{{ docker_registry }}" + username: "{{ docker_registry_username }}" + password: "{{ docker_registry_password }}" + insecure_registry: "{{ docker_insecure_registry }}" + name: swift_account_auditor + image: "{{ swift_account_auditor_image_full }}" + volumes: + - "{{ node_config_directory }}/swift/:/opt/kolla/swift/:ro" + - "{{ node_config_directory }}/swift-account-auditor/:/opt/kolla/swift-account-auditor/:ro" + volumes_from: + - swift_data + env: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + when: inventory_hostname in groups['swift-account-server'] + +- name: Starting Swift Account Replicator container + docker: + docker_api_version: "{{ docker_api_version }}" + net: host + pull: "{{ docker_pull_policy }}" + restart_policy: "{{ docker_restart_policy }}" + restart_policy_retry: "{{ docker_restart_policy_retry }}" + state: reloaded + registry: "{{ docker_registry }}" + username: "{{ docker_registry_username }}" + password: "{{ docker_registry_password }}" + insecure_registry: "{{ docker_insecure_registry }}" + name: swift_account_replicator + image: "{{ swift_account_replicator_image_full }}" + volumes: + - "{{ node_config_directory }}/swift/:/opt/kolla/swift/:ro" + - "{{ node_config_directory }}/swift-account-replicator/:/opt/kolla/swift-account-replicator/:ro" + volumes_from: + - swift_data + env: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + when: inventory_hostname in groups['swift-account-server'] + +- name: Starting Swift Account Reaper container + docker: + docker_api_version: "{{ docker_api_version }}" + net: host + pull: "{{ docker_pull_policy }}" + restart_policy: "{{ docker_restart_policy }}" + restart_policy_retry: "{{ docker_restart_policy_retry }}" + state: reloaded + registry: "{{ docker_registry }}" + username: "{{ docker_registry_username }}" + password: "{{ docker_registry_password }}" + insecure_registry: "{{ docker_insecure_registry }}" + name: swift_account_reaper + image: "{{ swift_account_reaper_image_full }}" + volumes: + - "{{ node_config_directory }}/swift/:/opt/kolla/swift/:ro" + - "{{ node_config_directory }}/swift-account-reaper/:/opt/kolla/swift-account-reaper/:ro" + volumes_from: + - swift_data + env: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + when: inventory_hostname in groups['swift-account-server'] + - name: Starting Swift Container Server container docker: docker_api_version: "{{ docker_api_version }}" @@ -68,6 +137,75 @@ KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" when: inventory_hostname in groups['swift-container-server'] +- name: Starting Swift Container Auditor container + docker: + docker_api_version: "{{ docker_api_version }}" + net: host + pull: "{{ docker_pull_policy }}" + restart_policy: "{{ docker_restart_policy }}" + restart_policy_retry: "{{ docker_restart_policy_retry }}" + state: reloaded + registry: "{{ docker_registry }}" + username: "{{ docker_registry_username }}" + password: "{{ docker_registry_password }}" + insecure_registry: "{{ docker_insecure_registry }}" + name: swift_container_auditor + image: "{{ swift_container_auditor_image_full }}" + volumes: + - "{{ node_config_directory }}/swift/:/opt/kolla/swift/:ro" + - "{{ node_config_directory }}/swift-container-auditor/:/opt/kolla/swift-container-auditor/:ro" + volumes_from: + - swift_data + env: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + when: inventory_hostname in groups['swift-container-server'] + +- name: Starting Swift Container Replicator container + docker: + docker_api_version: "{{ docker_api_version }}" + net: host + pull: "{{ docker_pull_policy }}" + restart_policy: "{{ docker_restart_policy }}" + restart_policy_retry: "{{ docker_restart_policy_retry }}" + state: reloaded + registry: "{{ docker_registry }}" + username: "{{ docker_registry_username }}" + password: "{{ docker_registry_password }}" + insecure_registry: "{{ docker_insecure_registry }}" + name: swift_container_replicator + image: "{{ swift_container_replicator_image_full }}" + volumes: + - "{{ node_config_directory }}/swift/:/opt/kolla/swift/:ro" + - "{{ node_config_directory }}/swift-container-replicator/:/opt/kolla/swift-container-replicator/:ro" + volumes_from: + - swift_data + env: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + when: inventory_hostname in groups['swift-container-server'] + +- name: Starting Swift Container Updater container + docker: + docker_api_version: "{{ docker_api_version }}" + net: host + pull: "{{ docker_pull_policy }}" + restart_policy: "{{ docker_restart_policy }}" + restart_policy_retry: "{{ docker_restart_policy_retry }}" + state: reloaded + registry: "{{ docker_registry }}" + username: "{{ docker_registry_username }}" + password: "{{ docker_registry_password }}" + insecure_registry: "{{ docker_insecure_registry }}" + name: swift_container_updater + image: "{{ swift_container_updater_image_full }}" + volumes: + - "{{ node_config_directory }}/swift/:/opt/kolla/swift/:ro" + - "{{ node_config_directory }}/swift-container-updater/:/opt/kolla/swift-container-updater/:ro" + volumes_from: + - swift_data + env: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + when: inventory_hostname in groups['swift-container-server'] + - name: Starting Swift Object Server container docker: docker_api_version: "{{ docker_api_version }}" @@ -90,3 +228,95 @@ env: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" when: inventory_hostname in groups['swift-object-server'] + +- name: Starting Swift Object Auditor container + docker: + docker_api_version: "{{ docker_api_version }}" + net: host + pull: "{{ docker_pull_policy }}" + restart_policy: "{{ docker_restart_policy }}" + restart_policy_retry: "{{ docker_restart_policy_retry }}" + state: reloaded + registry: "{{ docker_registry }}" + username: "{{ docker_registry_username }}" + password: "{{ docker_registry_password }}" + insecure_registry: "{{ docker_insecure_registry }}" + name: swift_object_auditor + image: "{{ swift_object_auditor_image_full }}" + volumes: + - "{{ node_config_directory }}/swift/:/opt/kolla/swift/:ro" + - "{{ node_config_directory }}/swift-object-auditor/:/opt/kolla/swift-object-auditor/:ro" + volumes_from: + - swift_data + env: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + when: inventory_hostname in groups['swift-object-server'] + +- name: Starting Swift Object Replicator container + docker: + docker_api_version: "{{ docker_api_version }}" + net: host + pull: "{{ docker_pull_policy }}" + restart_policy: "{{ docker_restart_policy }}" + restart_policy_retry: "{{ docker_restart_policy_retry }}" + state: reloaded + registry: "{{ docker_registry }}" + username: "{{ docker_registry_username }}" + password: "{{ docker_registry_password }}" + insecure_registry: "{{ docker_insecure_registry }}" + name: swift_object_replicator + image: "{{ swift_object_replicator_image_full }}" + volumes: + - "{{ node_config_directory }}/swift/:/opt/kolla/swift/:ro" + - "{{ node_config_directory }}/swift-object-replicator/:/opt/kolla/swift-object-replicator/:ro" + volumes_from: + - swift_data + env: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + when: inventory_hostname in groups['swift-object-server'] + +- name: Starting Swift Object Updater container + docker: + docker_api_version: "{{ docker_api_version }}" + net: host + pull: "{{ docker_pull_policy }}" + restart_policy: "{{ docker_restart_policy }}" + restart_policy_retry: "{{ docker_restart_policy_retry }}" + state: reloaded + registry: "{{ docker_registry }}" + username: "{{ docker_registry_username }}" + password: "{{ docker_registry_password }}" + insecure_registry: "{{ docker_insecure_registry }}" + name: swift_object_updater + image: "{{ swift_object_updater_image_full }}" + volumes: + - "{{ node_config_directory }}/swift/:/opt/kolla/swift/:ro" + - "{{ node_config_directory }}/swift-object-updater/:/opt/kolla/swift-object-updater/:ro" + volumes_from: + - swift_data + env: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + when: inventory_hostname in groups['swift-object-server'] + +- name: Starting Swift Object Expirer container + docker: + docker_api_version: "{{ docker_api_version }}" + net: host + pull: "{{ docker_pull_policy }}" + restart_policy: "{{ docker_restart_policy }}" + restart_policy_retry: "{{ docker_restart_policy_retry }}" + state: reloaded + registry: "{{ docker_registry }}" + username: "{{ docker_registry_username }}" + password: "{{ docker_registry_password }}" + insecure_registry: "{{ docker_insecure_registry }}" + name: swift_object_expirer + image: "{{ swift_object_expirer_image_full }}" + volumes: + - "{{ node_config_directory }}/swift/:/opt/kolla/swift/:ro" + - "{{ node_config_directory }}/swift-object-expirer/:/opt/kolla/swift-object-expirer/:ro" + volumes_from: + - swift_data + env: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + when: inventory_hostname in groups['swift-object-server'] diff --git a/ansible/roles/swift/templates/account-server.conf.j2 b/ansible/roles/swift/templates/account-server.conf.j2 index db7a63c6e9..0c78d2802b 100644 --- a/ansible/roles/swift/templates/account-server.conf.j2 +++ b/ansible/roles/swift/templates/account-server.conf.j2 @@ -9,3 +9,15 @@ pipeline = account-server [app:account-server] use = egg:swift#account + +{% if service_name == 'swift-account-auditor' %} +[account-auditor] +{% endif %} + +{% if service_name == 'swift-account-replicator' %} +[account-replicator] +{% endif %} + +{% if service_name == 'swift-account-reaper' %} +[account-reaper] +{% endif %} diff --git a/ansible/roles/swift/templates/container-server.conf.j2 b/ansible/roles/swift/templates/container-server.conf.j2 index 2baf9b72ce..83f827545c 100644 --- a/ansible/roles/swift/templates/container-server.conf.j2 +++ b/ansible/roles/swift/templates/container-server.conf.j2 @@ -9,3 +9,15 @@ pipeline = container-server [app:container-server] use = egg:swift#container + +{% if service_name == 'swift-container-auditor' %} +[container-auditor] +{% endif %} + +{% if service_name == 'swift-container-replicator' %} +[container-replicator] +{% endif %} + +{% if service_name == 'swift-container-updater' %} +[container-updater] +{% endif %} diff --git a/ansible/roles/swift/templates/object-server.conf.j2 b/ansible/roles/swift/templates/object-server.conf.j2 index 3f36d5e721..9d27be64a3 100644 --- a/ansible/roles/swift/templates/object-server.conf.j2 +++ b/ansible/roles/swift/templates/object-server.conf.j2 @@ -5,7 +5,30 @@ devices = {{ swift_devices_mount_point }} mount_check = false [pipeline:main] +{% if service_name == 'swift-object-expirer' %} +pipeline = proxy-server +{% else %} pipeline = object-server +{% endif %} [app:object-server] use = egg:swift#object + +{% if service_name == 'swift-object-auditor' %} +[object-auditor] +{% endif %} + +{% if service_name == 'swift-object-replicator' %} +[object-replicator] +{% endif %} + +{% if service_name == 'swift-object-updater' %} +[object-updater] +{% endif %} + +{% if service_name == 'swift-object-expirer' %} +[object-expirer] + +[app:proxy-server] +use = egg:swift#proxy +{% endif %} diff --git a/docker/swift/swift-account-auditor/Dockerfile.j2 b/docker/swift/swift-account-auditor/Dockerfile.j2 new file mode 100644 index 0000000000..7320de9f41 --- /dev/null +++ b/docker/swift/swift-account-auditor/Dockerfile.j2 @@ -0,0 +1,19 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-swift-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net.kolla) + +{% if install_type == 'binary' %} + {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %} + +RUN yum -y install \ + openstack-swift-account \ + && yum clean all + + {% endif %} +{% endif %} + +COPY start.sh / +COPY config-external.sh /opt/kolla/ + +CMD ["/start.sh"] + +{{ include_footer }} diff --git a/docker/swift/swift-account-auditor/config-external.sh b/docker/swift/swift-account-auditor/config-external.sh new file mode 100644 index 0000000000..955d75341c --- /dev/null +++ b/docker/swift/swift-account-auditor/config-external.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +if [[ -f /opt/kolla/swift/swift.conf ]]; then + cp /opt/kolla/swift/swift.conf /etc/swift/ + chown swift: /etc/swift/swift.conf + chmod 0640 /etc/swift/swift.conf +fi + +if [[ -f "/opt/kolla/swift/account.ring.gz" ]]; then + cp /opt/kolla/swift/account.ring.gz /etc/swift/account.ring.gz + chown swift: /etc/swift/account.ring.gz + chmod 0640 /etc/swift/account.ring.gz +fi + +if [[ -f /opt/kolla/swift-account-auditor/account-auditor.conf ]]; then + cp /opt/kolla/swift-account-auditor/account-auditor.conf /etc/swift/ + chown swift: /etc/swift/account-auditor.conf + chmod 0640 /etc/swift/account-auditor.conf +fi diff --git a/docker/swift/swift-account-auditor/start.sh b/docker/swift/swift-account-auditor/start.sh new file mode 100755 index 0000000000..c83000da11 --- /dev/null +++ b/docker/swift/swift-account-auditor/start.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/bin/swift-account-auditor" +ARGS="/etc/swift/account-auditor.conf --verbose" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS diff --git a/docker/swift/swift-account-reaper/Dockerfile.j2 b/docker/swift/swift-account-reaper/Dockerfile.j2 new file mode 100644 index 0000000000..7320de9f41 --- /dev/null +++ b/docker/swift/swift-account-reaper/Dockerfile.j2 @@ -0,0 +1,19 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-swift-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net.kolla) + +{% if install_type == 'binary' %} + {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %} + +RUN yum -y install \ + openstack-swift-account \ + && yum clean all + + {% endif %} +{% endif %} + +COPY start.sh / +COPY config-external.sh /opt/kolla/ + +CMD ["/start.sh"] + +{{ include_footer }} diff --git a/docker/swift/swift-account-reaper/config-external.sh b/docker/swift/swift-account-reaper/config-external.sh new file mode 100644 index 0000000000..dc2055ab31 --- /dev/null +++ b/docker/swift/swift-account-reaper/config-external.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +if [[ -f /opt/kolla/swift/swift.conf ]]; then + cp /opt/kolla/swift/swift.conf /etc/swift/ + chown swift: /etc/swift/swift.conf + chmod 0640 /etc/swift/swift.conf +fi + +if [[ -f "/opt/kolla/swift/account.ring.gz" ]]; then + cp /opt/kolla/swift/account.ring.gz /etc/swift/account.ring.gz + chown swift: /etc/swift/account.ring.gz + chmod 0640 /etc/swift/account.ring.gz +fi + +if [[ -f /opt/kolla/swift-account-reaper/account-reaper.conf ]]; then + cp /opt/kolla/swift-account-reaper/account-reaper.conf /etc/swift/ + chown swift: /etc/swift/account-reaper.conf + chmod 0640 /etc/swift/account-reaper.conf +fi diff --git a/docker/swift/swift-account-reaper/start.sh b/docker/swift/swift-account-reaper/start.sh new file mode 100755 index 0000000000..fb6dcfe367 --- /dev/null +++ b/docker/swift/swift-account-reaper/start.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/bin/swift-account-reaper" +ARGS="/etc/swift/account-reaper.conf --verbose" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS diff --git a/docker/swift/swift-account-replicator/Dockerfile.j2 b/docker/swift/swift-account-replicator/Dockerfile.j2 new file mode 100644 index 0000000000..7320de9f41 --- /dev/null +++ b/docker/swift/swift-account-replicator/Dockerfile.j2 @@ -0,0 +1,19 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-swift-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net.kolla) + +{% if install_type == 'binary' %} + {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %} + +RUN yum -y install \ + openstack-swift-account \ + && yum clean all + + {% endif %} +{% endif %} + +COPY start.sh / +COPY config-external.sh /opt/kolla/ + +CMD ["/start.sh"] + +{{ include_footer }} diff --git a/docker/swift/swift-account-replicator/config-external.sh b/docker/swift/swift-account-replicator/config-external.sh new file mode 100644 index 0000000000..062c524f25 --- /dev/null +++ b/docker/swift/swift-account-replicator/config-external.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +if [[ -f /opt/kolla/swift/swift.conf ]]; then + cp /opt/kolla/swift/swift.conf /etc/swift/ + chown swift: /etc/swift/swift.conf + chmod 0640 /etc/swift/swift.conf +fi + +if [[ -f "/opt/kolla/swift/account.ring.gz" ]]; then + cp /opt/kolla/swift/account.ring.gz /etc/swift/account.ring.gz + chown swift: /etc/swift/account.ring.gz + chmod 0640 /etc/swift/account.ring.gz +fi + +if [[ -f /opt/kolla/swift-account-replicator/account-replicator.conf ]]; then + cp /opt/kolla/swift-account-replicator/account-replicator.conf /etc/swift/ + chown swift: /etc/swift/account-replicator.conf + chmod 0640 /etc/swift/account-replicator.conf +fi diff --git a/docker/swift/swift-account-replicator/start.sh b/docker/swift/swift-account-replicator/start.sh new file mode 100755 index 0000000000..c820209e26 --- /dev/null +++ b/docker/swift/swift-account-replicator/start.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/bin/swift-account-replicator" +ARGS="/etc/swift/account-replicator.conf --verbose" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS diff --git a/docker/swift/swift-container-auditor/Dockerfile.j2 b/docker/swift/swift-container-auditor/Dockerfile.j2 new file mode 100644 index 0000000000..1a08c0f5dc --- /dev/null +++ b/docker/swift/swift-container-auditor/Dockerfile.j2 @@ -0,0 +1,19 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-swift-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net.kolla) + +{% if install_type == 'binary' %} + {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %} + +RUN yum -y install \ + openstack-swift-container \ + && yum clean all + + {% endif %} +{% endif %} + +COPY start.sh / +COPY config-external.sh /opt/kolla/ + +CMD ["/start.sh"] + +{{ include_footer }} diff --git a/docker/swift/swift-container-auditor/config-external.sh b/docker/swift/swift-container-auditor/config-external.sh new file mode 100644 index 0000000000..e01cc12ae3 --- /dev/null +++ b/docker/swift/swift-container-auditor/config-external.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +OWNER="swift" + +if [[ -f "/opt/kolla/swift/swift.conf" ]]; then + cp /opt/kolla/swift/swift.conf /etc/swift/swift.conf + chown ${OWNER}: /etc/swift/swift.conf + chmod 0640 /etc/swift/swift.conf +fi + +if [[ -f "/opt/kolla/swift/container.ring.gz" ]]; then + cp /opt/kolla/swift/container.ring.gz /etc/swift/container.ring.gz + chown ${OWNER}: /etc/swift/container.ring.gz + chmod 0640 /etc/swift/container.ring.gz +fi + +if [[ -f "/opt/kolla/swift-container-auditor/container-auditor.conf" ]]; then + cp /opt/kolla/swift-container-auditor/container-auditor.conf /etc/swift/container-auditor.conf + chown ${OWNER}: /etc/swift/container-auditor.conf + chmod 0640 /etc/swift/container-auditor.conf +fi diff --git a/docker/swift/swift-container-auditor/start.sh b/docker/swift/swift-container-auditor/start.sh new file mode 100755 index 0000000000..27dfd0e6bd --- /dev/null +++ b/docker/swift/swift-container-auditor/start.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/bin/swift-container-auditor" +ARGS="/etc/swift/container-auditor.conf --verbose" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS diff --git a/docker/swift/swift-container-replicator/Dockerfile.j2 b/docker/swift/swift-container-replicator/Dockerfile.j2 new file mode 100644 index 0000000000..1a08c0f5dc --- /dev/null +++ b/docker/swift/swift-container-replicator/Dockerfile.j2 @@ -0,0 +1,19 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-swift-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net.kolla) + +{% if install_type == 'binary' %} + {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %} + +RUN yum -y install \ + openstack-swift-container \ + && yum clean all + + {% endif %} +{% endif %} + +COPY start.sh / +COPY config-external.sh /opt/kolla/ + +CMD ["/start.sh"] + +{{ include_footer }} diff --git a/docker/swift/swift-container-replicator/config-external.sh b/docker/swift/swift-container-replicator/config-external.sh new file mode 100644 index 0000000000..439d4ae97a --- /dev/null +++ b/docker/swift/swift-container-replicator/config-external.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +OWNER="swift" + +if [[ -f "/opt/kolla/swift/swift.conf" ]]; then + cp /opt/kolla/swift/swift.conf /etc/swift/swift.conf + chown ${OWNER}: /etc/swift/swift.conf + chmod 0640 /etc/swift/swift.conf +fi + +if [[ -f "/opt/kolla/swift/container.ring.gz" ]]; then + cp /opt/kolla/swift/container.ring.gz /etc/swift/container.ring.gz + chown ${OWNER}: /etc/swift/container.ring.gz + chmod 0640 /etc/swift/container.ring.gz +fi + +if [[ -f "/opt/kolla/swift-container-replicator/container-replicator.conf" ]]; then + cp /opt/kolla/swift-container-replicator/container-replicator.conf /etc/swift/container-replicator.conf + chown ${OWNER}: /etc/swift/container-replicator.conf + chmod 0640 /etc/swift/container-replicator.conf +fi diff --git a/docker/swift/swift-container-replicator/start.sh b/docker/swift/swift-container-replicator/start.sh new file mode 100755 index 0000000000..b110ab8af8 --- /dev/null +++ b/docker/swift/swift-container-replicator/start.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/bin/swift-container-replicator" +ARGS="/etc/swift/container-replicator.conf --verbose" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS diff --git a/docker/swift/swift-container-updater/Dockerfile.j2 b/docker/swift/swift-container-updater/Dockerfile.j2 new file mode 100644 index 0000000000..1a08c0f5dc --- /dev/null +++ b/docker/swift/swift-container-updater/Dockerfile.j2 @@ -0,0 +1,19 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-swift-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net.kolla) + +{% if install_type == 'binary' %} + {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %} + +RUN yum -y install \ + openstack-swift-container \ + && yum clean all + + {% endif %} +{% endif %} + +COPY start.sh / +COPY config-external.sh /opt/kolla/ + +CMD ["/start.sh"] + +{{ include_footer }} diff --git a/docker/swift/swift-container-updater/config-external.sh b/docker/swift/swift-container-updater/config-external.sh new file mode 100644 index 0000000000..ea2d3b781a --- /dev/null +++ b/docker/swift/swift-container-updater/config-external.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +OWNER="swift" + +if [[ -f "/opt/kolla/swift/swift.conf" ]]; then + cp /opt/kolla/swift/swift.conf /etc/swift/swift.conf + chown ${OWNER}: /etc/swift/swift.conf + chmod 0640 /etc/swift/swift.conf +fi + +if [[ -f "/opt/kolla/swift/account.ring.gz" ]]; then + cp /opt/kolla/swift/account.ring.gz /etc/swift/account.ring.gz + chown swift: /etc/swift/account.ring.gz + chmod 0640 /etc/swift/account.ring.gz +fi + +if [[ -f "/opt/kolla/swift/container.ring.gz" ]]; then + cp /opt/kolla/swift/container.ring.gz /etc/swift/container.ring.gz + chown ${OWNER}: /etc/swift/container.ring.gz + chmod 0640 /etc/swift/container.ring.gz +fi + +if [[ -f "/opt/kolla/swift-container-updater/container-updater.conf" ]]; then + cp /opt/kolla/swift-container-updater/container-updater.conf /etc/swift/container-updater.conf + chown ${OWNER}: /etc/swift/container-updater.conf + chmod 0640 /etc/swift/container-updater.conf +fi diff --git a/docker/swift/swift-container-updater/start.sh b/docker/swift/swift-container-updater/start.sh new file mode 100755 index 0000000000..d2fe2eb8ca --- /dev/null +++ b/docker/swift/swift-container-updater/start.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/bin/swift-container-updater" +ARGS="/etc/swift/container-updater.conf --verbose" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS diff --git a/docker/swift/swift-object-auditor/config-external.sh b/docker/swift/swift-object-auditor/config-external.sh index 0fa02e9855..02be86bfd5 100644 --- a/docker/swift/swift-object-auditor/config-external.sh +++ b/docker/swift/swift-object-auditor/config-external.sh @@ -1,18 +1,27 @@ #!/bin/bash -SOURCE="/opt/kolla/swift/swift.conf" -TARGET="/etc/swift/swift.conf" -SOURCE_OBJECT_SERVER="/opt/kolla/swift/object-server.conf" -TARGET_OBJECT_SERVER="/etc/swift/object-server.conf" + OWNER="swift" -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0640 $TARGET +if [[ -f "/opt/kolla/swift/swift.conf" ]]; then + cp /opt/kolla/swift/swift.conf /etc/swift/swift.conf + chown ${OWNER}: /etc/swift/swift.conf + chmod 0640 /etc/swift/swift.conf fi -if [[ -f "$SOURCE_OBJECT_SERVER" ]]; then - cp $SOURCE_OBJECT_SERVER $TARGET_OBJECT_SERVER - chown ${OWNER}: $TARGET_OBJECT_SERVER - chmod 0640 $TARGET_OBJECT_SERVER +if [[ -f "/opt/kolla/swift/object.ring.gz" ]]; then + cp /opt/kolla/swift/object.ring.gz /etc/swift/object.ring.gz + chown ${OWNER}: /etc/swift/object.ring.gz + chmod 0640 /etc/swift/object.ring.gz +fi + +if [[ -f "/opt/kolla/swift/container.ring.gz" ]]; then + cp /opt/kolla/swift/container.ring.gz /etc/swift/container.ring.gz + chown ${OWNER}: /etc/swift/container.ring.gz + chmod 0640 /etc/swift/container.ring.gz +fi + +if [[ -f "/opt/kolla/swift-object-auditor/object-auditor.conf" ]]; then + cp /opt/kolla/swift-object-auditor/object-auditor.conf /etc/swift/object-auditor.conf + chown ${OWNER}: /etc/swift/object-auditor.conf + chmod 0640 /etc/swift/object-auditor.conf fi diff --git a/docker/swift/swift-object-auditor/start.sh b/docker/swift/swift-object-auditor/start.sh index 6319eed6bd..0f0111a8e3 100755 --- a/docker/swift/swift-object-auditor/start.sh +++ b/docker/swift/swift-object-auditor/start.sh @@ -3,13 +3,11 @@ set -o errexit CMD="/usr/bin/swift-object-auditor" -ARGS="/etc/swift/object-server.conf --verbose" +ARGS="/etc/swift/object-auditor.conf --verbose" # Loading common functions. source /opt/kolla/kolla-common.sh -source /opt/kolla/config-swift.sh - # Execute config strategy set_configs diff --git a/docker/swift/swift-object-expirer/config-external.sh b/docker/swift/swift-object-expirer/config-external.sh index ff2bcf9f5f..51fe26618d 100644 --- a/docker/swift/swift-object-expirer/config-external.sh +++ b/docker/swift/swift-object-expirer/config-external.sh @@ -1,18 +1,33 @@ #!/bin/bash -SOURCE="/opt/kolla/swift/swift.conf" -TARGET="/etc/swift/swift.conf" -SOURCE_OBJECT_EXPIRER="/opt/kolla/swift/object-expirer.conf" -TARGET_OBJECT_EXPIRER="/etc/swift/object-expirer.conf" + OWNER="swift" -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0640 $TARGET +if [[ -f "/opt/kolla/swift/swift.conf" ]]; then + cp /opt/kolla/swift/swift.conf /etc/swift/swift.conf + chown ${OWNER}: /etc/swift/swift.conf + chmod 0640 /etc/swift/swift.conf fi -if [[ -f "$SOURCE_OBJECT_EXPIRER" ]]; then - cp $SOURCE_OBJECT_EXPIRER $TARGET_OBJECT_EXPIRER - chown ${OWNER}: $TARGET_OBJECT_EXPIRER - chmod 0640 $TARGET_OBJECT_EXPIRER +if [[ -f "/opt/kolla/swift/object.ring.gz" ]]; then + cp /opt/kolla/swift/object.ring.gz /etc/swift/object.ring.gz + chown ${OWNER}: /etc/swift/object.ring.gz + chmod 0640 /etc/swift/object.ring.gz +fi + +if [[ -f "/opt/kolla/swift/container.ring.gz" ]]; then + cp /opt/kolla/swift/container.ring.gz /etc/swift/container.ring.gz + chown ${OWNER}: /etc/swift/container.ring.gz + chmod 0640 /etc/swift/container.ring.gz +fi + +if [[ -f "/opt/kolla/swift/account.ring.gz" ]]; then + cp /opt/kolla/swift/account.ring.gz /etc/swift/account.ring.gz + chown ${OWNER}: /etc/swift/account.ring.gz + chmod 0640 /etc/swift/account.ring.gz +fi + +if [[ -f "/opt/kolla/swift-object-expirer/object-expirer.conf" ]]; then + cp /opt/kolla/swift-object-expirer/object-expirer.conf /etc/swift/object-expirer.conf + chown ${OWNER}: /etc/swift/object-expirer.conf + chmod 0640 /etc/swift/object-expirer.conf fi diff --git a/docker/swift/swift-object-expirer/start.sh b/docker/swift/swift-object-expirer/start.sh index 434e8dc499..366525d118 100755 --- a/docker/swift/swift-object-expirer/start.sh +++ b/docker/swift/swift-object-expirer/start.sh @@ -3,13 +3,11 @@ set -o errexit CMD="/usr/bin/swift-object-expirer" -ARGS="/etc/swift/object-server.conf --verbose" +ARGS="/etc/swift/object-expirer.conf --verbose" # Loading common functions. source /opt/kolla/kolla-common.sh -source /opt/kolla/config-swift.sh - # Execute config strategy set_configs diff --git a/docker/swift/swift-object-replicator/config-external.sh b/docker/swift/swift-object-replicator/config-external.sh index 0fa02e9855..8277210881 100644 --- a/docker/swift/swift-object-replicator/config-external.sh +++ b/docker/swift/swift-object-replicator/config-external.sh @@ -1,18 +1,27 @@ #!/bin/bash -SOURCE="/opt/kolla/swift/swift.conf" -TARGET="/etc/swift/swift.conf" -SOURCE_OBJECT_SERVER="/opt/kolla/swift/object-server.conf" -TARGET_OBJECT_SERVER="/etc/swift/object-server.conf" + OWNER="swift" -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0640 $TARGET +if [[ -f "/opt/kolla/swift/swift.conf" ]]; then + cp /opt/kolla/swift/swift.conf /etc/swift/swift.conf + chown ${OWNER}: /etc/swift/swift.conf + chmod 0640 /etc/swift/swift.conf fi -if [[ -f "$SOURCE_OBJECT_SERVER" ]]; then - cp $SOURCE_OBJECT_SERVER $TARGET_OBJECT_SERVER - chown ${OWNER}: $TARGET_OBJECT_SERVER - chmod 0640 $TARGET_OBJECT_SERVER +if [[ -f "/opt/kolla/swift/object.ring.gz" ]]; then + cp /opt/kolla/swift/object.ring.gz /etc/swift/object.ring.gz + chown ${OWNER}: /etc/swift/object.ring.gz + chmod 0640 /etc/swift/object.ring.gz +fi + +if [[ -f "/opt/kolla/swift/container.ring.gz" ]]; then + cp /opt/kolla/swift/container.ring.gz /etc/swift/container.ring.gz + chown ${OWNER}: /etc/swift/container.ring.gz + chmod 0640 /etc/swift/container.ring.gz +fi + +if [[ -f "/opt/kolla/swift-object-replicator/object-replicator.conf" ]]; then + cp /opt/kolla/swift-object-replicator/object-replicator.conf /etc/swift/object-replicator.conf + chown ${OWNER}: /etc/swift/object-replicator.conf + chmod 0640 /etc/swift/object-replicator.conf fi diff --git a/docker/swift/swift-object-replicator/start.sh b/docker/swift/swift-object-replicator/start.sh index 203f8864d1..dbb1424990 100755 --- a/docker/swift/swift-object-replicator/start.sh +++ b/docker/swift/swift-object-replicator/start.sh @@ -3,13 +3,11 @@ set -o errexit CMD="/usr/bin/swift-object-replicator" -ARGS="/etc/swift/object-server.conf --verbose" +ARGS="/etc/swift/object-replicator.conf --verbose" # Loading common functions. source /opt/kolla/kolla-common.sh -source /opt/kolla/config-swift.sh - # Execute config strategy set_configs diff --git a/docker/swift/swift-object-updater/config-external.sh b/docker/swift/swift-object-updater/config-external.sh index 0fa02e9855..b94844476b 100644 --- a/docker/swift/swift-object-updater/config-external.sh +++ b/docker/swift/swift-object-updater/config-external.sh @@ -1,18 +1,27 @@ #!/bin/bash -SOURCE="/opt/kolla/swift/swift.conf" -TARGET="/etc/swift/swift.conf" -SOURCE_OBJECT_SERVER="/opt/kolla/swift/object-server.conf" -TARGET_OBJECT_SERVER="/etc/swift/object-server.conf" + OWNER="swift" -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0640 $TARGET +if [[ -f "/opt/kolla/swift/swift.conf" ]]; then + cp /opt/kolla/swift/swift.conf /etc/swift/swift.conf + chown ${OWNER}: /etc/swift/swift.conf + chmod 0640 /etc/swift/swift.conf fi -if [[ -f "$SOURCE_OBJECT_SERVER" ]]; then - cp $SOURCE_OBJECT_SERVER $TARGET_OBJECT_SERVER - chown ${OWNER}: $TARGET_OBJECT_SERVER - chmod 0640 $TARGET_OBJECT_SERVER +if [[ -f "/opt/kolla/swift/object.ring.gz" ]]; then + cp /opt/kolla/swift/object.ring.gz /etc/swift/object.ring.gz + chown ${OWNER}: /etc/swift/object.ring.gz + chmod 0640 /etc/swift/object.ring.gz +fi + +if [[ -f "/opt/kolla/swift/container.ring.gz" ]]; then + cp /opt/kolla/swift/container.ring.gz /etc/swift/container.ring.gz + chown ${OWNER}: /etc/swift/container.ring.gz + chmod 0640 /etc/swift/container.ring.gz +fi + +if [[ -f "/opt/kolla/swift-object-updater/object-updater.conf" ]]; then + cp /opt/kolla/swift-object-updater/object-updater.conf /etc/swift/object-updater.conf + chown ${OWNER}: /etc/swift/object-updater.conf + chmod 0640 /etc/swift/object-updater.conf fi diff --git a/docker/swift/swift-object-updater/start.sh b/docker/swift/swift-object-updater/start.sh index 744344f74c..5e970b4165 100755 --- a/docker/swift/swift-object-updater/start.sh +++ b/docker/swift/swift-object-updater/start.sh @@ -3,13 +3,11 @@ set -o errexit CMD="/usr/bin/swift-object-updater" -ARGS="/etc/swift/object-server.conf --verbose" +ARGS="/etc/swift/object-updater.conf --verbose" # Loading common functions. source /opt/kolla/kolla-common.sh -source /opt/kolla/config-swift.sh - # Execute config strategy set_configs diff --git a/etc/kolla/config/swift/account-auditor.conf b/etc/kolla/config/swift/account-auditor.conf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/kolla/config/swift/account-reaper.conf b/etc/kolla/config/swift/account-reaper.conf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/kolla/config/swift/account-replicator.conf b/etc/kolla/config/swift/account-replicator.conf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/kolla/config/swift/container-auditor.conf b/etc/kolla/config/swift/container-auditor.conf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/kolla/config/swift/container-replicator.conf b/etc/kolla/config/swift/container-replicator.conf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/kolla/config/swift/container-updater.conf b/etc/kolla/config/swift/container-updater.conf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/kolla/config/swift/object-auditor.conf b/etc/kolla/config/swift/object-auditor.conf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/kolla/config/swift/object-expirer.conf b/etc/kolla/config/swift/object-expirer.conf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/kolla/config/swift/object-replicator.conf b/etc/kolla/config/swift/object-replicator.conf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/kolla/config/swift/object-updater.conf b/etc/kolla/config/swift/object-updater.conf new file mode 100644 index 0000000000..e69de29bb2