Radosław Piliszek 21488710d6 Fix Swift with kernel 4.19 and later
We mount Swift volumes with xfs.
The 'nobarrier' option we used was made noop [1]
and deprecated [2] (with warning) in kernel 4.10.
In 4.19 it was removed [3] resulting in an error
when using e.g. Debian Buster as host.
The noop patch was backported to CentOS 7 so
it is safe to remove this option with no behavior
change and backport to where needed.
Ubuntu Bionic uses 4.15 which only warns.
CentOS 8 uses 4.18 which only warns as well.
Debian Buster uses 4.19 exactly which breaks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2291dab2c9d1880efd19469df2042e2277c8b7a4
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4cf4573d899cd80d8578c050061dc342f99f3a32
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1c02d502c20809a2a5f71ec16a930a61ed779b81

Change-Id: I006dea21321146c7fc738d0b41c401b72d271a99
Closes-bug: #1800132
2019-11-30 12:56:36 +01:00

316 lines
13 KiB
YAML

---
- name: Looking up disks for Swift
become: true
command: docker exec -t kolla_toolbox sudo -E ansible localhost
-m find_disks
-a "name={{ swift_devices_name }}
match_mode={{ swift_devices_match_mode }}"
register: swift_disk_lookup
changed_when: swift_disk_lookup.stdout.find('localhost | SUCCESS => ') != -1 and
(swift_disk_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed
failed_when: swift_disk_lookup.stdout.split()[2] != 'SUCCESS'
when: inventory_hostname in groups['swift-account-server'] or
inventory_hostname in groups['swift-container-server'] or
inventory_hostname in groups['swift-object-server']
- name: Reading data from variable
set_fact:
swift_disks: "{{ (swift_disk_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).disks|from_json }}"
when: inventory_hostname in groups['swift-account-server'] or
inventory_hostname in groups['swift-container-server'] or
inventory_hostname in groups['swift-object-server']
- name: Mounting Swift disks
become: true
mount:
src: "UUID={{ item.fs_uuid }}"
fstype: xfs
opts: "noatime,nodiratime,logbufs=8"
state: mounted
name: "{{ swift_devices_mount_point }}/{{ item['fs_label'] }}"
with_items: "{{ swift_disks }}"
when: inventory_hostname in groups['swift-account-server'] or
inventory_hostname in groups['swift-container-server'] or
inventory_hostname in groups['swift-object-server']
- name: Starting swift-rsyncd container
become: true
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ swift_rsyncd_image_full }}"
name: "swift_rsyncd"
volumes:
- "{{ node_config_directory }}/swift-rsyncd/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro"
when: inventory_hostname in groups['swift-account-server'] or
inventory_hostname in groups['swift-container-server'] or
inventory_hostname in groups['swift-object-server']
- name: Starting swift-account-server container
become: true
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
name: "swift_account_server"
image: "{{ swift_account_image_full }}"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-account-server/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro"
when: inventory_hostname in groups['swift-account-server']
- name: Starting swift-account-auditor container
become: true
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ swift_account_image_full }}"
name: "swift_account_auditor"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-account-auditor/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift"
when: inventory_hostname in groups['swift-account-server']
- name: Starting swift-account-replication-server container
become: true
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
environment:
RSYNC_CONNECT_PROG: "nc %H {{ swift_rsync_port }}"
image: "{{ swift_account_image_full }}"
name: "swift_account_replication_server"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-account-replication-server/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro"
when:
- inventory_hostname in groups['swift-account-server']
- swift_has_replication_network
- name: Starting swift-account-replicator container
become: true
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
environment:
RSYNC_CONNECT_PROG: "nc %H {{ swift_rsync_port }}"
image: "{{ swift_account_image_full }}"
name: "swift_account_replicator"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-account-replicator/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift"
when: inventory_hostname in groups['swift-account-server']
- name: Starting swift-account-reaper container
become: true
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ swift_account_image_full }}"
name: "swift_account_reaper"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-account-reaper/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro"
when: inventory_hostname in groups['swift-account-server']
- name: Starting swift-container-server container
become: true
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ swift_container_image_full }}"
name: "swift_container_server"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-container-server/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro"
when: inventory_hostname in groups['swift-container-server']
- name: Starting swift-container-auditor container
become: true
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ swift_container_image_full }}"
name: "swift_container_auditor"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-container-auditor/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift"
when: inventory_hostname in groups['swift-container-server']
- name: Starting swift-container-replication-server container
become: true
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
environment:
RSYNC_CONNECT_PROG: "nc %H {{ swift_rsync_port }}"
image: "{{ swift_container_image_full }}"
name: "swift_container_replication_server"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-container-replication-server/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro"
when:
- inventory_hostname in groups['swift-container-server']
- swift_has_replication_network
- name: Starting swift-container-replicator container
become: true
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
environment:
RSYNC_CONNECT_PROG: "nc %H {{ swift_rsync_port }}"
image: "{{ swift_container_image_full }}"
name: "swift_container_replicator"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-container-replicator/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift"
when: inventory_hostname in groups['swift-container-server']
- name: Starting swift-container-updater container
become: true
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ swift_container_image_full }}"
name: "swift_container_updater"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-container-updater/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift"
when: inventory_hostname in groups['swift-container-server']
- name: Starting swift-object-server container
become: true
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ swift_object_image_full }}"
name: "swift_object_server"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-object-server/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift:ro"
when: inventory_hostname in groups['swift-object-server']
- name: Starting swift-object-auditor container
become: true
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ swift_object_image_full }}"
name: "swift_object_auditor"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-object-auditor/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift"
when: inventory_hostname in groups['swift-object-server']
- name: Starting swift-object-replication-server container
become: true
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
environment:
RSYNC_CONNECT_PROG: "nc %H {{ swift_rsync_port }}"
image: "{{ swift_object_image_full }}"
name: "swift_object_replication_server"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-object-replication-server/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro"
when:
- inventory_hostname in groups['swift-object-server']
- swift_has_replication_network
- name: Starting swift-object-replicator container
become: true
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
environment:
RSYNC_CONNECT_PROG: "nc %H {{ swift_rsync_port }}"
image: "{{ swift_object_image_full }}"
name: "swift_object_replicator"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-object-replicator/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift"
when: inventory_hostname in groups['swift-object-server']
- name: Starting swift-object-updater container
become: true
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ swift_object_image_full }}"
name: "swift_object_updater"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-object-updater/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift"
when: inventory_hostname in groups['swift-object-server']
- name: Starting swift-object-expirer container
become: true
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ swift_object_expirer_image_full }}"
name: "swift_object_expirer"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-object-expirer/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}:shared"
- "/etc/localtime:/etc/localtime:ro"
- "swift_recon_cache:/var/cache/swift"
when: inventory_hostname in groups['swift-object-server']
- name: Starting swift-proxy-server container
become: true
kolla_docker:
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'] and
run_start_swift_proxy_server | bool