diff options
author | Stefanie Forrester <dak1n1@users.noreply.github.com> | 2016-01-28 13:55:19 -0800 |
---|---|---|
committer | Stefanie Forrester <dak1n1@users.noreply.github.com> | 2016-01-28 13:55:19 -0800 |
commit | d92f00d2b00f53ccdf1905afc2d279d041a2331d (patch) | |
tree | 104ab0570fbb54c4f9f7420b1bae8f5a3f476857 /playbooks/adhoc/s3_registry | |
parent | b88c68ae778574ee617fdd5db51dc8e9ec22d954 (diff) | |
parent | ed8717ca91e80a573f22516b8aff0cf387861970 (diff) | |
download | openshift-d92f00d2b00f53ccdf1905afc2d279d041a2331d.tar.gz openshift-d92f00d2b00f53ccdf1905afc2d279d041a2331d.tar.bz2 openshift-d92f00d2b00f53ccdf1905afc2d279d041a2331d.tar.xz openshift-d92f00d2b00f53ccdf1905afc2d279d041a2331d.zip |
Merge pull request #1265 from talset/s3_registry_clusterid
Allow to have custom bucket name and region
Diffstat (limited to 'playbooks/adhoc/s3_registry')
-rw-r--r-- | playbooks/adhoc/s3_registry/s3_registry.j2 | 4 | ||||
-rw-r--r-- | playbooks/adhoc/s3_registry/s3_registry.yml | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/playbooks/adhoc/s3_registry/s3_registry.j2 b/playbooks/adhoc/s3_registry/s3_registry.j2 index acfa89515..2972cc3aa 100644 --- a/playbooks/adhoc/s3_registry/s3_registry.j2 +++ b/playbooks/adhoc/s3_registry/s3_registry.j2 @@ -9,8 +9,8 @@ storage: s3: accesskey: {{ aws_access_key }} secretkey: {{ aws_secret_key }} - region: us-east-1 - bucket: {{ clusterid }}-docker + region: {{ aws_bucket_region }} + bucket: {{ aws_bucket_name }} encrypt: true secure: true v4auth: true diff --git a/playbooks/adhoc/s3_registry/s3_registry.yml b/playbooks/adhoc/s3_registry/s3_registry.yml index d409b4086..0814efae2 100644 --- a/playbooks/adhoc/s3_registry/s3_registry.yml +++ b/playbooks/adhoc/s3_registry/s3_registry.yml @@ -1,7 +1,7 @@ --- # This playbook creates an S3 bucket named after your cluster and configures the docker-registry service to use the bucket as its backend storage. # Usage: -# ansible-playbook s3_registry.yml -e clusterid="mycluster" +# ansible-playbook s3_registry.yml -e clusterid="mycluster" -e aws_bucket="clusterid-docker" -e aws_region="us-east-1" # # The AWS access/secret keys should be the keys of a separate user (not your main user), containing only the necessary S3 access role. # The 'clusterid' is the short name of your cluster. @@ -13,6 +13,8 @@ vars: aws_access_key: "{{ lookup('env', 'S3_ACCESS_KEY_ID') }}" aws_secret_key: "{{ lookup('env', 'S3_SECRET_ACCESS_KEY') }}" + aws_bucket_name: "{{ aws_bucket | default(clusterid ~ '-docker') }}" + aws_bucket_region: "{{ aws_region | lookup('env', 'S3_REGION') | default('us-east-1') }}" tasks: @@ -29,7 +31,7 @@ - name: Create S3 bucket local_action: - module: s3 bucket="{{ clusterid }}-docker" mode=create + module: s3 bucket="{{ aws_bucket_name }}" mode=create - name: Set up registry environment variable command: oc env dc/docker-registry REGISTRY_CONFIGURATION_PATH=/etc/registryconfig/config.yml |