summaryrefslogtreecommitdiffstats
path: root/roles/openshift_hosted
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_hosted')
-rw-r--r--roles/openshift_hosted/tasks/registry/registry.yml4
-rw-r--r--roles/openshift_hosted/tasks/registry/secure.yml2
-rw-r--r--roles/openshift_hosted/tasks/router/router.yml4
-rw-r--r--roles/openshift_hosted/templates/registry_config.j283
4 files changed, 48 insertions, 45 deletions
diff --git a/roles/openshift_hosted/tasks/registry/registry.yml b/roles/openshift_hosted/tasks/registry/registry.yml
index 4e525a2da..93b701ebc 100644
--- a/roles/openshift_hosted/tasks/registry/registry.yml
+++ b/roles/openshift_hosted/tasks/registry/registry.yml
@@ -30,7 +30,7 @@
- name: Create OpenShift registry
command: >
- {{ openshift.common.admin_binary }} registry --create
+ {{ openshift.common.client_binary }} adm registry --create
--config={{ openshift_hosted_kubeconfig }}
{% if replicas > 1 -%}
--replicas={{ replicas }}
@@ -53,7 +53,7 @@
- include: secure.yml
static: no
- when: replicas | int > 0
+ when: replicas | int > 0 and not (openshift.docker.hosted_registry_insecure | default(false) | bool)
- include: storage/object_storage.yml
static: no
diff --git a/roles/openshift_hosted/tasks/registry/secure.yml b/roles/openshift_hosted/tasks/registry/secure.yml
index 664edef41..d2f6ba5f6 100644
--- a/roles/openshift_hosted/tasks/registry/secure.yml
+++ b/roles/openshift_hosted/tasks/registry/secure.yml
@@ -33,7 +33,7 @@
- name: Create registry certificates if they do not exist
command: >
- {{ openshift.common.admin_binary }} ca create-server-cert
+ {{ openshift.common.client_binary }} adm ca create-server-cert
--signer-cert=/etc/origin/master/ca.crt
--signer-key=/etc/origin/master/ca.key
--signer-serial=/etc/origin/master/ca.serial.txt
diff --git a/roles/openshift_hosted/tasks/router/router.yml b/roles/openshift_hosted/tasks/router/router.yml
index 0cad19c34..b944fa522 100644
--- a/roles/openshift_hosted/tasks/router/router.yml
+++ b/roles/openshift_hosted/tasks/router/router.yml
@@ -48,7 +48,7 @@
- name: Create OpenShift router
command: >
- {{ openshift.common.admin_binary }} router --create
+ {{ openshift.common.client_binary }} adm router --create
--config={{ openshift_hosted_kubeconfig }}
{% if replicas > 1 -%}
--replicas={{ replicas }}
@@ -73,7 +73,7 @@
{% if openshift.hosted.router.name | default(none) is not none -%}
{{ openshift.hosted.router.name }}
{% endif -%}
-
+
register: openshift_hosted_router_results
changed_when: "'service exists' not in openshift_hosted_router_results.stdout"
failed_when: "openshift_hosted_router_results.rc != 0 and 'service exists' not in openshift_hosted_router_results.stdout and 'deployment_config' not in openshift_hosted_router_results.stderr and 'service' not in openshift_hosted_router_results.stderr"
diff --git a/roles/openshift_hosted/templates/registry_config.j2 b/roles/openshift_hosted/templates/registry_config.j2
index cfe7ac81c..557fd03af 100644
--- a/roles/openshift_hosted/templates/registry_config.j2
+++ b/roles/openshift_hosted/templates/registry_config.j2
@@ -8,52 +8,55 @@ storage:
enabled: true
cache:
blobdescriptor: inmemory
-{% if openshift.hosted.registry.storage.provider == 's3' %}
+{% if openshift_hosted_registry_storage_provider | default('') == 's3' %}
s3:
- accesskey: {{ openshift.hosted.registry.storage.s3.accesskey }}
- secretkey: {{ openshift.hosted.registry.storage.s3.secretkey }}
- region: {{ openshift.hosted.registry.storage.s3.region }}
- bucket: {{ openshift.hosted.registry.storage.s3.bucket }}
+ accesskey: {{ openshift_hosted_registry_storage_s3_accesskey }}
+ secretkey: {{ openshift_hosted_registry_storage_s3_secretkey }}
+ region: {{ openshift_hosted_registry_storage_s3_region }}
+{% if openshift_hosted_registry_storage_s3_regionendpoint is defined %}
+ regionendpoint: {{ openshift_hosted_registry_storage_s3_regionendpoint }}
+{% endif %}
+ bucket: {{ openshift_hosted_registry_storage_s3_bucket }}
encrypt: false
secure: true
v4auth: true
- rootdirectory: {{ openshift.hosted.registry.storage.s3.rootdirectory | default('/registry') }}
- chunksize: "{{ openshift.hosted.registry.storage.s3.chunksize | default(26214400) }}"
-{% elif openshift.hosted.registry.storage.provider == 'azure_blob' %}
+ rootdirectory: {{ openshift_hosted_registry_storage_s3_rootdirectory | default('/registry') }}
+ chunksize: "{{ openshift_hosted_registry_storage_s3_chunksize | default(26214400) }}"
+{% elif openshift_hosted_registry_storage_provider | default('') == 'azure_blob' %}
azure:
- accountname: {{ openshift.hosted.registry.storage.azure_blob.accountname }}
- accountkey: {{ openshift.hosted.registry.storage.azure_blob.accountkey }}
- container: {{ openshift.hosted.registry.storage.azure_blob.container }}
- realm: {{ openshift.hosted.registry.storage.azure_blob.realm }}
-{% elif openshift.hosted.registry.storage.provider == 'swift' %}
+ accountname: {{ openshift_hosted_registry_storage_azure_blob_accountname }}
+ accountkey: {{ openshift_hosted_registry_storage_azure_blob_accountkey }}
+ container: {{ openshift_hosted_registry_storage_azure_blob_container }}
+ realm: {{ openshift_hosted_registry_storage_azure_blob_realm }}
+{% elif openshift_hosted_registry_storage_provider | default('') == 'swift' %}
swift:
- authurl: {{ openshift.hosted.registry.storage.swift.authurl }}
- username: {{ openshift.hosted.registry.storage.swift.username }}
- password: {{ openshift.hosted.registry.storage.swift.password }}
- container: {{ openshift.hosted.registry.storage.swift.container }}
-{% if 'region' in openshift.hosted.registry.storage.swift %}
- region: {{ openshift.hosted.registry.storage.swift.region }}
+ authurl: {{ openshift_hosted_registry_storage_swift_authurl }}
+ username: {{ openshift_hosted_registry_storage_swift_username }}
+ password: {{ openshift_hosted_registry_storage_swift_password }}
+ container: {{ openshift_hosted_registry_storage_swift_container }}
+{% if openshift_hosted_registry_storage_swift_region is defined %}
+ region: {{ openshift_hosted_registry_storage_swift_region }}
{% endif -%}
-{% if 'tenant' in openshift.hosted.registry.storage.swift %}
- tenant: {{ openshift.hosted.registry.storage.swift.tenant }}
+{% if openshift_hosted_registry_storage_swift_tenant is defined %}
+ tenant: {{ openshift_hosted_registry_storage_swift_tenant }}
{% endif -%}
-{% if 'tenantid' in openshift.hosted.registry.storage.swift %}
- tenantid: {{ openshift.hosted.registry.storage.swift.tenantid }}
+{% if openshift_hosted_registry_storage_swift_tenantid is defined %}
+ tenantid: {{ openshift_hosted_registry_storage_swift_tenantid }}
{% endif -%}
-{% if 'domain' in openshift.hosted.registry.storage.swift %}
- domain: {{ openshift.hosted.registry.storage.swift.domain }}
+{% if openshift_hosted_registry_storage_swift_domain is defined %}
+ domain: {{ openshift_hosted_registry_storage_swift_domain }}
{% endif -%}
-{% if 'domainid' in openshift.hosted.registry.storage.swift %}
- domainid: {{ openshift.hosted.registry.storage.swift.domainid }}
+{% if openshift_hosted_registry_storage_swift_domainid %}
+ domainid: {{ openshift_hosted_registry_storage_swift_domainid }}
{% endif -%}
-{% elif openshift.hosted.registry.storage.provider == 'gcs' %}
+{% elif openshift_hosted_registry_storage_provider | default('') == 'gcs' %}
gcs:
- bucket: {{ openshift.hosted.registry.storage.gcs.bucket }}
-{% if 'keyfile' in openshift.hosted.registry.storage.gcs %}
- keyfile: {{ openshift.hosted.registry.storage.gcs.keyfile }}
+ bucket: {{ openshift_hosted_registry_storage_gcs_bucket }}
+{% if openshift_hosted_registry_storage_gcs_keyfile is defined %}
+ keyfile: {{ openshift_hosted_registry_storage_gcs_keyfile }}
{% endif -%}
-{% if 'rootdirectory' in openshift.hosted.registry.storage.gcs %}
- rootdirectory: {{ openshift.hosted.registry.storage.gcs.rootdirectory }}
+{% if openshift_hosted_registry_storage_gcs_rootdirectory is defined %}
+ rootdirectory: {{ openshift_hosted_registry_storage_gcs_rootdirectory }}
{% endif -%}
{% endif -%}
auth:
@@ -67,16 +70,16 @@ middleware:
repository:
- name: openshift
options:
- pullthrough: {{ openshift.hosted.registry.pullthrough | default(true) }}
- acceptschema2: {{ openshift.hosted.registry.acceptschema2 | default(false) }}
- enforcequota: {{ openshift.hosted.registry.enforcequota | default(false) }}
-{% if openshift.hosted.registry.storage.provider == 's3' and 'cloudfront' in openshift.hosted.registry.storage.s3 %}
+ pullthrough: {{ openshift_hosted_registry_pullthrough | default(true) }}
+ acceptschema2: {{ openshift_hosted_registry_acceptschema2 | default(false) }}
+ enforcequota: {{ openshift_hosted_registry_enforcequota | default(false) }}
+{% if openshift_hosted_registry_storage_provider | default('') == 's3' and openshift_hosted_registry_storage_s3_cloudfront_baseurl is defined %}
storage:
- name: cloudfront
options:
- baseurl: {{ openshift.hosted.registry.storage.s3.cloudfront.baseurl }}
- privatekey: {{ openshift.hosted.registry.storage.s3.cloudfront.privatekeyfile }}
- keypairid: {{ openshift.hosted.registry.storage.s3.cloudfront.keypairid }}
+ baseurl: {{ openshift_hosted_registry_storage_s3_cloudfront_baseurl }}
+ privatekey: {{ openshift_hosted_registry_storage_s3_cloudfront_privatekeyfile }}
+ keypairid: {{ openshift_hosted_registry_storage_s3_cloudfront_keypairid }}
{% elif openshift.common.version_gte_3_3_or_1_3 | bool %}
storage:
- name: openshift