kolla-ansible/ansible/roles/swift/tasks/rolling_upgrade.yml
Martin Hiner a13d83400f Rename kolla_docker to kolla_container
Changes name of ansible module kolla_docker to
kolla_container.

Change-Id: I13c676ed0378aa721a21a1300f6054658ad12bc7
Signed-off-by: Martin Hiner <m.hiner@partner.samsung.com>
2023-11-15 13:54:57 +01:00

69 lines
2.8 KiB
YAML

---
- name: Prepare Swift containers list
set_fact:
swift_containers:
- { name: swift_account_server, group: swift-account-server }
- { name: swift_account_auditor, group: swift-account-server }
- { name: swift_account_replicator, group: swift-account-server }
- { name: swift_account_reaper, group: swift-account-server }
- { name: swift_rsyncd, group: swift-account-server }
- { name: swift_container_server, group: swift-container-server }
- { name: swift_container_auditor, group: swift-container-server }
- { name: swift_container_replicator, group: swift-container-server }
- { name: swift_container_updater, group: swift-container-server }
- { name: swift_rsyncd, group: swift-container-server }
- { name: swift_object_server, group: swift-object-server }
- { name: swift_object_auditor, group: swift-object-server }
- { name: swift_object_replicator, group: swift-object-server }
- { name: swift_object_updater, group: swift-object-server }
- { name: swift_object_expirer, group: swift-object-server }
- { name: swift_rsyncd, group: swift-object-server }
# Upgrade swift storage nodes first
- include_tasks: config.yml
when: inventory_hostname in groups['swift-account-server'] or
inventory_hostname in groups['swift-container-server'] or
inventory_hostname in groups['swift-object-server']
# TODO(donghm): Below tasks should be run in serial nodes to
# decrease downtime. Update once the module ansible strategy for
# rolling upgrade will be finished.
- name: Gracefully shutdown swift services in storage nodes
become: true
kolla_container:
common_options: "{{ docker_common_options }}"
action: "stop_container"
name: "{{ item.name }}"
when: inventory_hostname in groups[item.group]
with_items:
- "{{ swift_containers }}"
- import_tasks: start.yml
vars:
run_start_swift_proxy_server: "no"
# Upgrade swift proxy nodes
- include_tasks: config.yml
when: inventory_hostname in groups['swift-proxy-server']
- name: Gracefully shutdown swift proxy services in proxy nodes
become: true
kolla_container:
common_options: "{{ docker_common_options }}"
action: "stop_container"
name: "swift_proxy_server"
when: inventory_hostname in groups['swift-proxy-server']
- name: Start new swift proxy server container
become: true
kolla_container:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ swift_proxy_server_image_full }}"
name: "swift_proxy_server"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-proxy-server/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
when: inventory_hostname in groups['swift-proxy-server']