summaryrefslogtreecommitdiffstats
path: root/playbooks/adhoc
diff options
context:
space:
mode:
authorWesley Hearn <wesley.s.hearn@gmail.com>2015-10-21 15:23:30 -0400
committerWesley Hearn <wesley.s.hearn@gmail.com>2015-10-21 15:23:30 -0400
commit9f3d3e9d0e697ce85620ac0a7a7c5eeba892f1d6 (patch)
tree315c8752e2527fb71dc389b254393977d44a7074 /playbooks/adhoc
parentedfd8dc450854d6f2efa6c3d67e856b66b3743fd (diff)
parent8691cd2947146a24237fadc443eb02acf805a606 (diff)
downloadopenshift-9f3d3e9d0e697ce85620ac0a7a7c5eeba892f1d6.tar.gz
openshift-9f3d3e9d0e697ce85620ac0a7a7c5eeba892f1d6.tar.bz2
openshift-9f3d3e9d0e697ce85620ac0a7a7c5eeba892f1d6.tar.xz
openshift-9f3d3e9d0e697ce85620ac0a7a7c5eeba892f1d6.zip
Merge pull request #571 from dak1n1/router
Support HA or single router. Deploy after service accounts are created
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