diff options
author | Steve Milner <smilner@redhat.com> | 2017-02-03 15:46:41 -0500 |
---|---|---|
committer | Steve Milner <smilner@redhat.com> | 2017-02-06 13:18:31 -0500 |
commit | 10ef2f931240e473581bf22f15e3d4c81d334c97 (patch) | |
tree | b0207b86c499fdb206527277767bf21c59f2df84 /roles/openshift_hosted/tasks | |
parent | a965c28ab7ca6ac93c70e4a2415316ddaf52812e (diff) | |
download | openshift-10ef2f931240e473581bf22f15e3d4c81d334c97.tar.gz openshift-10ef2f931240e473581bf22f15e3d4c81d334c97.tar.bz2 openshift-10ef2f931240e473581bf22f15e3d4c81d334c97.tar.xz openshift-10ef2f931240e473581bf22f15e3d4c81d334c97.zip |
Copies CloudFront pem file to registry hosts
This change copies the CloudFront private key to registry hosts when
the provider is set to s3 and CloudFront baseurl, privatekey, and
keyparid are all provided. It also adds the following variable
examples in the host inventory files:
- openshift_hosted_registry_storage_s3_cloudfront_baseurl
- openshift_hosted_registry_storage_s3_cloudfront_privatekeyfile
- openshift_hosted_registry_storage_s3_cloudfront_keypairid
See https://bugzilla.redhat.com/show_bug.cgi?id=1395168
Diffstat (limited to 'roles/openshift_hosted/tasks')
-rw-r--r-- | roles/openshift_hosted/tasks/registry/storage/s3.yml | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/roles/openshift_hosted/tasks/registry/storage/s3.yml b/roles/openshift_hosted/tasks/registry/storage/s3.yml index 707be9c00..f73d9f0ae 100644 --- a/roles/openshift_hosted/tasks/registry/storage/s3.yml +++ b/roles/openshift_hosted/tasks/registry/storage/s3.yml @@ -10,3 +10,24 @@ openshift_hosted_registry_storage_s3_bucket and openshift_hosted_registry_storage_s3_region are required when: openshift.hosted.registry.storage.s3.bucket | default(none) is none or openshift.hosted.registry.storage.s3.region | default(none) is none + +# If cloudfront is being used, fail if we don't have all the required variables +- assert: + that: + - "openshift_hosted_registry_storage_s3_cloudfront_baseurl is not defined or openshift_hosted_registry_storage_s3_cloudfront_privatekeyfile | default(none) is not none" + - "openshift_hosted_registry_storage_s3_cloudfront_baseurl is not defined or 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 + +# Copy the cloudfront.pem to the host if the baseurl is given +- name: Copy cloudfront.pem to the registry + copy: + src: "{{ openshift_hosted_registry_storage_s3_cloudfront_privatekeyfile }}" + dest: /etc/s3-cloudfront/cloudfront.pem + backup: true + owner: root + group: root + mode: 0600 + when: openshift_hosted_registry_storage_s3_cloudfront_baseurl | default(none) is not none |