84 lines
2.5 KiB
YAML
84 lines
2.5 KiB
YAML
---
|
|
# Copyright 2019 Red Hat, Inc.
|
|
# All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
- name: Collect facts
|
|
hosts: all
|
|
gather_facts: false
|
|
any_errors_fatal: true
|
|
tasks:
|
|
- name: Gather a minimal set of facts
|
|
setup:
|
|
gather_subset: '!all,min'
|
|
|
|
- name: Converge
|
|
hosts: localhost
|
|
connection: local
|
|
any_errors_fatal: true
|
|
tasks:
|
|
- name: Install openssl for file creation
|
|
package:
|
|
name: openssl
|
|
state: present
|
|
become: true
|
|
|
|
- name: Create test directories
|
|
file:
|
|
state: directory
|
|
path: "{{ item }}"
|
|
loop:
|
|
- "{{ test_src_dir }}"
|
|
- "{{ test_dst_dir }}"
|
|
- "{{ test2_src_dir }}"
|
|
- "{{ test2_dst_dir }}"
|
|
|
|
- name: Create 1GB src test files with random content
|
|
shell: >-
|
|
openssl rand -out {{ item }} -base64 $(( 2**30 * 3/4 ))
|
|
args:
|
|
chdir: "{{ test_src_dir }}"
|
|
creates: "{{ item }}"
|
|
loop: "{{ test_src_files }}"
|
|
|
|
- name: Create empty dst test files with random content
|
|
file:
|
|
path: "{{ test_dst_dir }}/{{ item }}"
|
|
state: touch
|
|
loop: "{{ test_dst_files }}"
|
|
|
|
- include_role:
|
|
name: "tripleo_transfer"
|
|
vars:
|
|
tripleo_transfer_src_host: controller2
|
|
tripleo_transfer_src_dir: "{{ test_src_dir }}"
|
|
tripleo_transfer_dest_host: controller1
|
|
tripleo_transfer_dest_dir: "{{ test_dst_dir }}"
|
|
|
|
- name: Create empty src test files
|
|
file:
|
|
state: touch
|
|
path: "{{ test2_src_dir }}/{{ item }}"
|
|
loop: "{{ test2_src_files + test2_exclude_src_files }}"
|
|
|
|
- include_role:
|
|
name: "tripleo_transfer"
|
|
vars:
|
|
tripleo_transfer_src_host: controller2
|
|
tripleo_transfer_src_dir: "{{ test2_src_dir }}"
|
|
tripleo_transfer_dest_host: controller1
|
|
tripleo_transfer_dest_dir: "{{ test2_dst_dir }}"
|
|
tripleo_transfer_exclude: "{{ test2_exclude_pattern }}"
|
|
tripleo_transfer_include: "{{ test2_include_pattern }}"
|