- hosts: all vars: zuul_log_aws_access_key: minioadmin zuul_log_aws_secret_key: minioadmin zuul_log_bucket: zuul test_content: "123abc" roles: - clear-firewall - ensure-docker - ensure-pip tasks: - name: Install boto pip: extra_args: "--break-system-packages" name: - boto3 - botocore - name: Start minio server command: >- docker run -d -p 9000:9000 -e MINIO_ACCESS_KEY={{ zuul_log_aws_access_key }} -e MINIO_SECRET_KEY={{ zuul_log_aws_secret_key }} quay.io/minio/minio server /data - name: Make sure bucket exists s3_bucket: name: "{{ zuul_log_bucket }}" state: present s3_url: 'http://localhost:9000' aws_access_key: "{{ zuul_log_aws_access_key }}" aws_secret_key: "{{ zuul_log_aws_secret_key }}" - name: Add content to tempfile delegate_to: localhost copy: content: "{{ test_content }}" dest: "{{ zuul.executor.log_root }}/testfile" - name: Upload file to s3 include_role: name: upload-logs-s3 vars: upload_logs_s3_endpoint: 'http://{{ ansible_host }}:9000' - name: Download mc get_url: url: https://dl.min.io/client/mc/release/linux-amd64/mc dest: "{{ ansible_user_dir }}/mc" mode: 0755 - name: Add localhost minio host command: "{{ ansible_user_dir }}/mc alias set local http://localhost:9000 {{ zuul_log_aws_access_key }} {{ zuul_log_aws_secret_key }}" - name: List files in minio bucket command: "{{ ansible_user_dir }}/mc find local/zuul" - name: Check for testfile in minio bucket command: "{{ ansible_user_dir }}/mc find local/zuul/{{ zuul_log_path }}/testfile"