diff --git a/templates/github/.ci/ansible/start_container.yaml b/templates/github/.ci/ansible/start_container.yaml index 4ef94c86..f0b4d43c 100644 --- a/templates/github/.ci/ansible/start_container.yaml +++ b/templates/github/.ci/ansible/start_container.yaml @@ -55,13 +55,35 @@ become: true - name: "Create Pulp Bucket" - amazon.aws.s3_bucket: - aws_access_key: "{{ minio_access_key }}" - aws_secret_key: "{{ minio_secret_key }}" - endpoint_url: "http://minio:9000" - region: "eu-central-1" - name: "pulp3" - state: "present" + ansible.builtin.command: + argv: + - "python3" + - "-c" + - | + import boto3 + from botocore.exceptions import ClientError + client = boto3.client( + "s3", + aws_access_key_id="{{ minio_access_key }}", + aws_secret_access_key="{{ minio_secret_key }}", + endpoint_url="http://minio:9000", + region_name="eu-central-1", + ) + try: + client.create_bucket( + Bucket="pulp3", + CreateBucketConfiguration={"LocationConstraint": "eu-central-1"}, + ) + except ClientError as exc: + if exc.response["Error"]["Code"] not in ( + "BucketAlreadyOwnedByYou", + "BucketAlreadyExists", + ): + raise + register: "create_bucket" + retries: 6 + delay: 5 + until: "create_bucket is succeeded" when: "s3_test | default(false)" - name: "Wait on Services" diff --git a/templates/github/.github/workflows/scripts/install.sh.j2 b/templates/github/.github/workflows/scripts/install.sh.j2 index 0c603ce8..9cab86d5 100755 --- a/templates/github/.github/workflows/scripts/install.sh.j2 +++ b/templates/github/.github/workflows/scripts/install.sh.j2 @@ -14,18 +14,6 @@ PIP_REQUIREMENTS=("{{ cli_package }}" "yq") # This must be the **only** package install on the test runner. uv pip install ${PIP_REQUIREMENTS[*]} - -if [[ "$TEST" = "s3" ]]; then -for i in {1..3} -do - ansible-galaxy collection install "amazon.aws:11.1.0" && s=0 && break || s=$? && sleep 3 -done -if [[ $s -gt 0 ]] -then - echo "Failed to install amazon.aws" - exit $s -fi -fi {%- if test_cli %} # Check out the {{ cli_package }} branch matching the installed version.