2018-10-29 20:30:59 +08:00
|
|
|
---
|
|
|
|
- hosts: rgws
|
|
|
|
gather_facts: True
|
|
|
|
become: True
|
|
|
|
vars:
|
2020-03-09 18:05:01 +08:00
|
|
|
s3cmd_cmd: "s3cmd --no-ssl --access_key=P9Eb6S8XNyo4dtZZUUMy --secret_key=qqHCUtfdNnpHq3PZRHW5un9l0bEBM812Uhow0XfB --host={{ rgw_multisite_endpoint_addr }}:8080 --host-bucket={{ rgw_multisite_endpoint_addr }}:8080"
|
2018-10-29 20:30:59 +08:00
|
|
|
tasks:
|
|
|
|
- name: install s3cmd
|
|
|
|
package:
|
|
|
|
name: s3cmd
|
|
|
|
state: present
|
2018-12-19 21:55:01 +08:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2020-02-08 04:58:17 +08:00
|
|
|
when: not containerized_deployment | default(false) | bool
|
2018-10-29 20:30:59 +08:00
|
|
|
|
|
|
|
- name: generate and upload a random 10Mb file - containerized deployment
|
|
|
|
command: >
|
2020-01-07 00:14:22 +08:00
|
|
|
podman run --rm --name=rgw_multisite_test --entrypoint=/bin/bash {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} -c 'dd if=/dev/urandom of=/tmp/testinfra.img bs=1M count=10; {{ s3cmd_cmd }} mb s3://testinfra; {{ s3cmd_cmd }} put /tmp/testinfra.img s3://testinfra'
|
2018-10-29 20:30:59 +08:00
|
|
|
when:
|
2019-05-22 16:02:42 +08:00
|
|
|
- rgw_zonemaster | bool
|
|
|
|
- containerized_deployment | default(False) | bool
|
2018-10-29 20:30:59 +08:00
|
|
|
|
|
|
|
- name: generate and upload a random a 10Mb file - non containerized
|
|
|
|
shell: >
|
|
|
|
dd if=/dev/urandom of=/tmp/testinfra.img bs=1M count=10;
|
|
|
|
{{ s3cmd_cmd }} mb s3://testinfra;
|
|
|
|
{{ s3cmd_cmd }} put /tmp/testinfra.img s3://testinfra
|
|
|
|
when:
|
2019-05-22 16:02:42 +08:00
|
|
|
- rgw_zonemaster | default(False) | bool
|
|
|
|
- not containerized_deployment | default(False) | bool
|
2018-10-29 20:30:59 +08:00
|
|
|
|
|
|
|
- name: get info from replicated file - containerized deployment
|
|
|
|
command: >
|
2020-01-07 00:14:22 +08:00
|
|
|
podman run --rm --name=rgw_multisite_test --entrypoint=/bin/bash {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} -c '{{ s3cmd_cmd }} info s3://testinfra/testinfra.img'
|
2018-10-29 20:30:59 +08:00
|
|
|
register: s3cmd_info_status
|
|
|
|
when:
|
2019-05-22 16:02:42 +08:00
|
|
|
- not rgw_zonemaster | default(False) | bool
|
|
|
|
- containerized_deployment | default(False) | bool
|
2018-10-29 20:30:59 +08:00
|
|
|
retries: 10
|
|
|
|
delay: 2
|
|
|
|
until: s3cmd_info_status.get('rc', 1) == 0
|
|
|
|
|
|
|
|
- name: get info from replicated file - non containerized
|
|
|
|
command: >
|
|
|
|
{{ s3cmd_cmd }} info s3://testinfra/testinfra.img
|
|
|
|
register: s3cmd_info_status
|
|
|
|
when:
|
2019-05-22 16:02:42 +08:00
|
|
|
- not rgw_zonemaster | default(False) | bool
|
|
|
|
- not containerized_deployment | default(False) | bool
|
2018-10-29 20:30:59 +08:00
|
|
|
retries: 10
|
|
|
|
delay: 2
|
|
|
|
until: s3cmd_info_status.get('rc', 1) == 0
|