summaryrefslogtreecommitdiffstats
path: root/playbooks/adhoc
diff options
context:
space:
mode:
authorHugo Rosnet <hrosnet@redhat.com>2016-02-18 18:56:05 +0100
committerHugo Rosnet <hrosnet@redhat.com>2016-02-18 18:56:05 +0100
commit3d77c13d82e5abbd1d3684d0baa882e6b21fa602 (patch)
tree799390c5390d2f2617af8c43c918ea3efa96e8d1 /playbooks/adhoc
parent630bfbd5a1b7d8045fdaf1082d82eaa5b95bd316 (diff)
downloadopenshift-3d77c13d82e5abbd1d3684d0baa882e6b21fa602.tar.gz
openshift-3d77c13d82e5abbd1d3684d0baa882e6b21fa602.tar.bz2
openshift-3d77c13d82e5abbd1d3684d0baa882e6b21fa602.tar.xz
openshift-3d77c13d82e5abbd1d3684d0baa882e6b21fa602.zip
Add extra parameters for S3 registry: delete file, create bucket.
It would be nice to have options to be able to: * Delete or not the temporary config file - so that it can be check/modified directly * Create or not the bucket, as you might not have the right to do so This commit allows both of those things, without changing the default behavior of the playbook.
Diffstat (limited to 'playbooks/adhoc')
-rw-r--r--playbooks/adhoc/s3_registry/s3_registry.yml4
1 files changed, 4 insertions, 0 deletions
diff --git a/playbooks/adhoc/s3_registry/s3_registry.yml b/playbooks/adhoc/s3_registry/s3_registry.yml
index 38ce92e92..e24d8196f 100644
--- a/playbooks/adhoc/s3_registry/s3_registry.yml
+++ b/playbooks/adhoc/s3_registry/s3_registry.yml
@@ -15,6 +15,8 @@
aws_secret_key: "{{ lookup('env', 'S3_SECRET_ACCESS_KEY') }}"
aws_bucket_name: "{{ aws_bucket | default(clusterid ~ '-docker') }}"
aws_bucket_region: "{{ aws_region | default(lookup('env', 'S3_REGION') | default('us-east-1', true)) }}"
+ aws_create_bucket: "{{ aws_create | default(True) }}"
+ aws_delete_after_run: "{{ aws_delete_temp | default(True) }}"
tasks:
@@ -30,6 +32,7 @@
command: oc scale --replicas=0 dc/docker-registry
- name: Create S3 bucket
+ when: aws_create_bucket | bool
local_action:
module: s3 bucket="{{ aws_bucket_name }}" mode=create
@@ -71,3 +74,4 @@
- name: Delete temporary config file
file: path=/root/config.yml state=absent
+ when: aws_delete_after_run | bool