summaryrefslogtreecommitdiffstats
path: root/playbooks/adhoc
diff options
context:
space:
mode:
authorStefanie Forrester <sedgar@redhat.com>2015-09-11 13:13:17 -0700
committerStefanie Forrester <sedgar@redhat.com>2015-10-21 12:55:42 -0400
commit8691cd2947146a24237fadc443eb02acf805a606 (patch)
tree0aee79ec29eab0d36ea9b2f13f079bbb259dcc77 /playbooks/adhoc
parent0b89d53ad9c0c83c42db3ee1642c005474c3cc58 (diff)
downloadopenshift-8691cd2947146a24237fadc443eb02acf805a606.tar.gz
openshift-8691cd2947146a24237fadc443eb02acf805a606.tar.bz2
openshift-8691cd2947146a24237fadc443eb02acf805a606.tar.xz
openshift-8691cd2947146a24237fadc443eb02acf805a606.zip
Support HA or single router, and start work on registry
Diffstat (limited to 'playbooks/adhoc')
-rw-r--r--playbooks/adhoc/s3_registry/s3_registry.yml16
1 files changed, 13 insertions, 3 deletions
diff --git a/playbooks/adhoc/s3_registry/s3_registry.yml b/playbooks/adhoc/s3_registry/s3_registry.yml
index 5dc1abf17..4dcef1a42 100644
--- a/playbooks/adhoc/s3_registry/s3_registry.yml
+++ b/playbooks/adhoc/s3_registry/s3_registry.yml
@@ -6,13 +6,14 @@
# 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.
-- hosts: security_group_{{ clusterid }}_master
+- hosts: tag_env-host-type_{{ clusterid }}-openshift-master
remote_user: root
gather_facts: False
vars:
- aws_access_key: "{{ lookup('env', 'AWS_ACCESS_KEY_ID') }}"
- aws_secret_key: "{{ lookup('env', 'AWS_SECRET_ACCESS_KEY') }}"
+ aws_access_key: "{{ lookup('env', 'S3_ACCESS_KEY_ID') }}"
+ aws_secret_key: "{{ lookup('env', 'S3_SECRET_ACCESS_KEY') }}"
+
tasks:
- name: Check for AWS creds
@@ -23,10 +24,16 @@
- aws_access_key
- aws_secret_key
+ - name: Scale down registry
+ command: oc scale --replicas=0 dc/docker-registry
+
- name: Create S3 bucket
local_action:
module: s3 bucket="{{ clusterid }}-docker" mode=create
+ - name: Set up registry environment variable
+ command: oc env dc/docker-registry REGISTRY_CONFIGURATION_PATH=/etc/registryconfig/config.yml
+
- name: Generate docker registry config
template: src="s3_registry.j2" dest="/root/config.yml" owner=root mode=0600
@@ -54,6 +61,9 @@
command: oc volume dc/docker-registry --add --name=dockersecrets -m /etc/registryconfig --type=secret --secret-name=dockerregistry
when: "'dockersecrets' not in dc.stdout"
+ - name: Wait for deployment config to take effect before scaling up
+ pause: seconds=30
+
- name: Scale up registry
command: oc scale --replicas=1 dc/docker-registry