From 82d61ae9e23c2ae1f722ed3b458a6e39721e71fd Mon Sep 17 00:00:00 2001 From: Michael Gugino Date: Thu, 31 Aug 2017 18:01:56 -0400 Subject: Refactor openshift_hosted plays and role Currently, openshift_hosted role duplicates some logic across separate task chains. This commit cleans up the openshift_hosted role and converts it to be primarily used with include_role to give better logic to the playbooks that utilize this role. This commit also refactors the playbook that calls various openshift_hosted roles into individual playbooks. This allows more granularity for advanced users. --- .../openshift_hosted/tasks/registry/storage/s3.yml | 45 ---------------------- 1 file changed, 45 deletions(-) delete mode 100644 roles/openshift_hosted/tasks/registry/storage/s3.yml (limited to 'roles/openshift_hosted/tasks/registry/storage/s3.yml') diff --git a/roles/openshift_hosted/tasks/registry/storage/s3.yml b/roles/openshift_hosted/tasks/registry/storage/s3.yml deleted file mode 100644 index 318969885..000000000 --- a/roles/openshift_hosted/tasks/registry/storage/s3.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -- name: Assert that S3 variables are provided for registry_config template - assert: - that: - - openshift.hosted.registry.storage.s3.bucket | default(none) is not none - - openshift.hosted.registry.storage.s3.region | default(none) is not none - msg: | - When using S3 storage, the following variables are required: - openshift_hosted_registry_storage_s3_bucket - openshift_hosted_registry_storage_s3_region - -- name: If cloudfront is being used, assert that we have all the required variables - assert: - that: - - "openshift_hosted_registry_storage_s3_cloudfront_privatekeyfile | default(none) is not none" - - "openshift_hosted_registry_storage_s3_cloudfront_keypairid | default(none) is not none" - msg: | - When openshift_hosted_registry_storage_s3_cloudfront_baseurl is provided - openshift_hosted_registry_storage_s3_cloudfront_keypairid and - openshift_hosted_registry_storage_s3_cloudfront_privatekeyfile are required - when: openshift_hosted_registry_storage_s3_cloudfront_baseurl is defined - -# Inject the cloudfront private key as a secret when required -- block: - - - name: Create registry secret for cloudfront - oc_secret: - state: present - namespace: "{{ openshift_hosted_registry_namespace }}" - name: docker-registry-s3-cloudfront - contents: - - path: cloudfront.pem - data: "{{ lookup('file', openshift_hosted_registry_storage_s3_cloudfront_privatekeyfile) }}" - - - name: Append cloudfront secret registry volume to openshift_hosted_registry_volumes - set_fact: - openshift_hosted_registry_volumes: "{{ openshift_hosted_registry_volumes | union(s3_volume_mount) }}" - vars: - s3_volume_mount: - - name: cloudfront-vol - path: /etc/origin - type: secret - secret_name: docker-registry-s3-cloudfront - - when: openshift_hosted_registry_storage_s3_cloudfront_baseurl | default(none) is not none -- cgit v1.2.3