2018-10-29 20:30:59 +08:00
|
|
|
---
|
|
|
|
- hosts: rgws
|
|
|
|
gather_facts: True
|
|
|
|
become: True
|
|
|
|
tasks:
|
|
|
|
- name: check if it is Atomic host
|
|
|
|
stat: path=/run/ostree-booted
|
|
|
|
register: stat_ostree
|
|
|
|
check_mode: no
|
|
|
|
|
|
|
|
- name: set fact for using Atomic host
|
|
|
|
set_fact:
|
|
|
|
is_atomic: '{{ stat_ostree.stat.exists }}'
|
|
|
|
|
2020-12-11 21:36:00 +08:00
|
|
|
- name: import_role ceph-defaults
|
|
|
|
import_role:
|
|
|
|
name: ceph-defaults
|
|
|
|
|
|
|
|
- name: import_role ceph-facts
|
|
|
|
include_role:
|
|
|
|
name: ceph-facts
|
|
|
|
tasks_from: "{{ item }}.yml"
|
|
|
|
with_items:
|
|
|
|
- set_radosgw_address
|
|
|
|
- container_binary
|
|
|
|
|
2018-10-29 20:30:59 +08:00
|
|
|
- name: install s3cmd
|
|
|
|
package:
|
|
|
|
name: s3cmd
|
|
|
|
state: present
|
2018-12-19 21:55:01 +08:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2019-05-22 16:02:42 +08:00
|
|
|
when: not is_atomic | bool
|
2018-10-29 20:30:59 +08:00
|
|
|
|
|
|
|
- name: generate and upload a random 10Mb file - containerized deployment
|
2020-12-11 21:36:00 +08:00
|
|
|
shell: >
|
|
|
|
{{ container_binary }} run --rm --name=rgw_multisite_test --entrypoint=bash {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} -c 'dd if=/dev/urandom of=/tmp/testinfra-{{ item.rgw_realm }}.img bs=1M count=10;
|
|
|
|
s3cmd --no-ssl --access_key={{ item.system_access_key }} --secret_key={{ item.system_secret_key }} --host={{ item.radosgw_address }}:{{ item.radosgw_frontend_port }} --host-bucket={{ item.radosgw_address }}:{{ item.radosgw_frontend_port }} mb s3://testinfra-{{ item.rgw_realm }};
|
|
|
|
s3cmd --no-ssl --access_key={{ item.system_access_key }} --secret_key={{ item.system_secret_key }} --host={{ item.radosgw_address }}:{{ item.radosgw_frontend_port }} --host-bucket={{ item.radosgw_address }}:{{ item.radosgw_frontend_port }} put /tmp/testinfra-{{ item.rgw_realm }}.img s3://testinfra-{{ item.rgw_realm }}'
|
|
|
|
with_items: "{{ rgw_instances_host }}"
|
2018-10-29 20:30:59 +08:00
|
|
|
when:
|
2019-05-22 16:02:42 +08:00
|
|
|
- rgw_zonemaster | bool
|
2020-12-11 21:36:00 +08:00
|
|
|
- containerized_deployment | bool
|
2018-10-29 20:30:59 +08:00
|
|
|
|
|
|
|
- name: generate and upload a random a 10Mb file - non containerized
|
2020-12-11 21:36:00 +08:00
|
|
|
shell: |
|
|
|
|
dd if=/dev/urandom of=/tmp/testinfra-{{ item.rgw_realm }}.img bs=1M count=10;
|
|
|
|
s3cmd --no-ssl --access_key={{ item.system_access_key }} --secret_key={{ item.system_secret_key }} --host={{ item.radosgw_address }}:{{ item.radosgw_frontend_port }} --host-bucket={{ item.radosgw_address }}:{{ item.radosgw_frontend_port }} mb s3://testinfra-{{ item.rgw_realm }};
|
|
|
|
s3cmd --no-ssl --access_key={{ item.system_access_key }} --secret_key={{ item.system_secret_key }} --host={{ item.radosgw_address }}:{{ item.radosgw_frontend_port }} --host-bucket={{ item.radosgw_address }}:{{ item.radosgw_frontend_port }} put /tmp/testinfra-{{ item.rgw_realm }}.img s3://testinfra-{{ item.rgw_realm }};
|
|
|
|
with_items: "{{ rgw_instances_host }}"
|
2018-10-29 20:30:59 +08:00
|
|
|
when:
|
2020-12-11 21:36:00 +08:00
|
|
|
- rgw_zonemaster | bool
|
|
|
|
- not containerized_deployment | bool
|
2018-10-29 20:30:59 +08:00
|
|
|
|
|
|
|
- name: get info from replicated file - containerized deployment
|
|
|
|
command: >
|
2020-12-11 21:36:00 +08:00
|
|
|
{{ container_binary }} run --rm --name=rgw_multisite_test --entrypoint=s3cmd {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} --no-ssl --access_key={{ item.system_access_key }} --secret_key={{ item.system_secret_key }} --host={{ item.radosgw_address }}:{{ item.radosgw_frontend_port }} --host-bucket={{ item.radosgw_address }}:{{ item.radosgw_frontend_port }} info s3://testinfra-{{ item.rgw_realm }}/testinfra-{{ item.rgw_realm }}.img
|
|
|
|
with_items: "{{ rgw_instances_host }}"
|
|
|
|
register: result
|
|
|
|
retries: 60
|
|
|
|
delay: 1
|
|
|
|
until: result is succeeded
|
2018-10-29 20:30:59 +08:00
|
|
|
when:
|
2020-12-11 21:36:00 +08:00
|
|
|
- not rgw_zonemaster | bool
|
|
|
|
- containerized_deployment | bool
|
2018-10-29 20:30:59 +08:00
|
|
|
|
|
|
|
- name: get info from replicated file - non containerized
|
|
|
|
command: >
|
2020-12-11 21:36:00 +08:00
|
|
|
s3cmd --no-ssl --access_key={{ item.system_access_key }} --secret_key={{ item.system_secret_key }} --host={{ item.radosgw_address }}:{{ item.radosgw_frontend_port }} --host-bucket={{ item.radosgw_address }}:{{ item.radosgw_frontend_port }} info s3://testinfra-{{ item.rgw_realm }}/testinfra-{{ item.rgw_realm }}.img
|
|
|
|
with_items: "{{ rgw_instances_host }}"
|
|
|
|
register: result
|
|
|
|
retries: 60
|
|
|
|
delay: 1
|
|
|
|
until: result is succeeded
|
2018-10-29 20:30:59 +08:00
|
|
|
when:
|
2020-12-11 21:36:00 +08:00
|
|
|
- not rgw_zonemaster | bool
|
|
|
|
- not containerized_deployment | bool
|