From 2fe8715d9935dc7372dab68fa2b93a702265a119 Mon Sep 17 00:00:00 2001 From: Samuel Munilla Date: Wed, 27 Jul 2016 09:14:42 -0400 Subject: Add support for Atomic Registry Installs Add the Registry deployment subtype as an option in the quick installer. --- playbooks/common/openshift-cluster/additional_config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'playbooks/common') diff --git a/playbooks/common/openshift-cluster/additional_config.yml b/playbooks/common/openshift-cluster/additional_config.yml index ebbd45a67..c3b1a9365 100644 --- a/playbooks/common/openshift-cluster/additional_config.yml +++ b/playbooks/common/openshift-cluster/additional_config.yml @@ -15,6 +15,8 @@ when: openshift.common.use_manageiq | bool - role: cockpit when: not openshift.common.is_atomic and ( deployment_type in ['atomic-enterprise','openshift-enterprise'] ) and - (osm_use_cockpit | bool or osm_use_cockpit is undefined ) + (osm_use_cockpit | bool or osm_use_cockpit is undefined ) and ( deployment_subtype != 'registry' ) + - role: cockpit-ui + when: not openshift.common.is_atomic and ( deployment_subtype == 'registry' ) - role: flannel_register when: openshift.common.use_flannel | bool -- cgit v1.2.3 From 2e975430061785e1acf2189e57ee7bfaee1a9411 Mon Sep 17 00:00:00 2001 From: Andrew Butcher Date: Tue, 23 Aug 2016 16:24:46 -0400 Subject: Re-organize registry-console deployment. --- .../common/openshift-cluster/additional_config.yml | 2 - .../common/openshift-cluster/openshift_hosted.yml | 3 ++ roles/cockpit-ui/tasks/main.yml | 48 ++++++++++++++++++---- 3 files changed, 43 insertions(+), 10 deletions(-) (limited to 'playbooks/common') diff --git a/playbooks/common/openshift-cluster/additional_config.yml b/playbooks/common/openshift-cluster/additional_config.yml index c3b1a9365..ba6a4eace 100644 --- a/playbooks/common/openshift-cluster/additional_config.yml +++ b/playbooks/common/openshift-cluster/additional_config.yml @@ -16,7 +16,5 @@ - role: cockpit when: not openshift.common.is_atomic and ( deployment_type in ['atomic-enterprise','openshift-enterprise'] ) and (osm_use_cockpit | bool or osm_use_cockpit is undefined ) and ( deployment_subtype != 'registry' ) - - role: cockpit-ui - when: not openshift.common.is_atomic and ( deployment_subtype == 'registry' ) - role: flannel_register when: openshift.common.use_flannel | bool diff --git a/playbooks/common/openshift-cluster/openshift_hosted.yml b/playbooks/common/openshift-cluster/openshift_hosted.yml index c90c85cbd..7028ad438 100644 --- a/playbooks/common/openshift-cluster/openshift_hosted.yml +++ b/playbooks/common/openshift-cluster/openshift_hosted.yml @@ -1,3 +1,4 @@ +--- - name: Create persistent volumes hosts: oo_first_master tags: @@ -43,3 +44,5 @@ - role: openshift_hosted - role: openshift_metrics when: openshift.hosted.metrics.deploy | bool + - role: cockpit-ui + when: not openshift.common.is_atomic and ( deployment_subtype == 'registry' ) diff --git a/roles/cockpit-ui/tasks/main.yml b/roles/cockpit-ui/tasks/main.yml index 1fa289653..31aa3ce0b 100644 --- a/roles/cockpit-ui/tasks/main.yml +++ b/roles/cockpit-ui/tasks/main.yml @@ -1,15 +1,47 @@ --- -- name: Expose registry with route - command: oc expose service docker-registry +- name: Expose docker-registry + command: > + {{ openshift.common.client_binary }} expose service docker-registry -n default + register: expose_docker_registry + changed_when: "'already exists' not in expose_docker_registry.stderr" + failed_when: "'already exists' not in expose_docker_registry.stderr and expose_docker_registry.rc != 0" -- name: Install Cockpit template - command: oc create -f registry-console.yaml -n default +- name: Create passthrough route for registry-console + command: > + {{ openshift.common.client_binary }} create route passthrough + --service registry-console + --port registry-console + -n default + register: create_registry_console_route + changed_when: "'already exists' not in create_registry_console_route.stderr" + failed_when: "'already exists' not in create_registry_console_route.stderr and create_registry_console_route.rc != 0" -- name: Create passthrough route for Registry - command: oc create route passthrough --service registry-console --port registry-console -n default +- name: Retrieve docker-registry route + command: "{{ openshift.common.client_binary }} get route docker-registry -n default --template='{{ '{{' }} .spec.host {{ '}}' }}'" + register: docker_registry_route + failed_when: false + changed_when: false -- name: Deploy Registry - command: oc new-app -n default --template=registry-console -p OPENSHIFT_OAUTH_PROVIDER_URL="{{ openshift_https_proxy }}:8443",REGISTRY_HOST=$(oc get route docker-registry -n default --template='{{ .spec.host }}'),COCKPIT_KUBE_URL=$(oc get route registry-console -n default --template='https://{{ .spec.host }}') +- name: Retrieve cockpit kube url + command: "{{ openshift.common.client_binary }} get route registry-console -n default --template='https://{{ '{{' }} .spec.host {{ '}}' }}'" + register: registry_console_cockpit_kube_url + failed_when: false + changed_when: false + +- set_fact: + cockpit_image_prefix: "{{ '-p IMAGE_PREFIX=' ~ openshift_cockpit_deployer_prefix | default('') }}" + +- name: Deploy registry-console + command: > + {{ openshift.common.client_binary }} new-app --template=registry-console + {{ cockpit_image_prefix }} + -p OPENSHIFT_OAUTH_PROVIDER_URL="{{ openshift.master.public_api_url }}" + -p REGISTRY_HOST="{{ docker_registry_route.stdout }}" + -p COCKPIT_KUBE_URL="{{ registry_console_cockpit_kube_url.stdout }}" + -n default + register: deploy_registry_console + changed_when: "'already exists' not in deploy_registry_console.stderr" + failed_when: "'already exists' not in deploy_registry_console.stderr and deploy_registry_console.rc != 0" - name: Enable cockpit-ui service: -- cgit v1.2.3 From 517f3390c14bc9bf570581a914fa64ac55c1ccd9 Mon Sep 17 00:00:00 2001 From: Samuel Munilla Date: Thu, 25 Aug 2016 09:20:17 -0400 Subject: Remove atomic check and cockpit.socket --- playbooks/byo/openshift-cluster/config.yml | 2 +- playbooks/common/openshift-cluster/additional_config.yml | 2 +- playbooks/common/openshift-cluster/openshift_hosted.yml | 2 +- roles/cockpit-ui/tasks/main.yml | 7 ------- roles/openshift_facts/library/openshift_facts.py | 2 +- roles/openshift_facts/tasks/main.yml | 2 +- utils/src/ooinstall/openshift_ansible.py | 3 --- utils/src/ooinstall/variants.py | 6 +++--- 8 files changed, 8 insertions(+), 18 deletions(-) (limited to 'playbooks/common') diff --git a/playbooks/byo/openshift-cluster/config.yml b/playbooks/byo/openshift-cluster/config.yml index 6c5ece9bd..0b85b2485 100644 --- a/playbooks/byo/openshift-cluster/config.yml +++ b/playbooks/byo/openshift-cluster/config.yml @@ -26,4 +26,4 @@ openshift_cluster_id: "{{ cluster_id | default('default') }}" openshift_debug_level: "{{ debug_level | default(2) }}" openshift_deployment_type: "{{ deployment_type }}" - openshift_deployment_subtype: "{{ deployment_subtype }}" + openshift_deployment_subtype: "{{ deployment_subtype | default(none) }}" diff --git a/playbooks/common/openshift-cluster/additional_config.yml b/playbooks/common/openshift-cluster/additional_config.yml index ba6a4eace..26b31d313 100644 --- a/playbooks/common/openshift-cluster/additional_config.yml +++ b/playbooks/common/openshift-cluster/additional_config.yml @@ -15,6 +15,6 @@ when: openshift.common.use_manageiq | bool - role: cockpit when: not openshift.common.is_atomic and ( deployment_type in ['atomic-enterprise','openshift-enterprise'] ) and - (osm_use_cockpit | bool or osm_use_cockpit is undefined ) and ( deployment_subtype != 'registry' ) + (osm_use_cockpit | bool or osm_use_cockpit is undefined ) and ( openshift.common.deployment_subtype != 'registry' ) - role: flannel_register when: openshift.common.use_flannel | bool diff --git a/playbooks/common/openshift-cluster/openshift_hosted.yml b/playbooks/common/openshift-cluster/openshift_hosted.yml index 7028ad438..f65b7a2cd 100644 --- a/playbooks/common/openshift-cluster/openshift_hosted.yml +++ b/playbooks/common/openshift-cluster/openshift_hosted.yml @@ -45,4 +45,4 @@ - role: openshift_metrics when: openshift.hosted.metrics.deploy | bool - role: cockpit-ui - when: not openshift.common.is_atomic and ( deployment_subtype == 'registry' ) + when: ( openshift.common.deployment_subtype == 'registry' ) diff --git a/roles/cockpit-ui/tasks/main.yml b/roles/cockpit-ui/tasks/main.yml index 31aa3ce0b..00a7da4a9 100644 --- a/roles/cockpit-ui/tasks/main.yml +++ b/roles/cockpit-ui/tasks/main.yml @@ -42,10 +42,3 @@ register: deploy_registry_console changed_when: "'already exists' not in deploy_registry_console.stderr" failed_when: "'already exists' not in deploy_registry_console.stderr and deploy_registry_console.rc != 0" - -- name: Enable cockpit-ui - service: - name: cockpit.socket - enabled: true - state: started - when: not openshift.common.is_containerized | bool diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index 805f36cec..ebd799466 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -797,7 +797,7 @@ def set_deployment_facts_if_unset(facts): curr_disabled_features = set(facts['master']['disabled_features']) facts['master']['disabled_features'] = list(curr_disabled_features.union(openshift_features)) else: - if deployment_type == 'atomic-enterprise': + if facts['common']['deployment_subtype'] == 'registry': facts['master']['disabled_features'] = openshift_features if 'node' in facts: diff --git a/roles/openshift_facts/tasks/main.yml b/roles/openshift_facts/tasks/main.yml index 725bb2160..afeb78f95 100644 --- a/roles/openshift_facts/tasks/main.yml +++ b/roles/openshift_facts/tasks/main.yml @@ -24,7 +24,7 @@ local_facts: # TODO: Deprecate deployment_type in favor of openshift_deployment_type deployment_type: "{{ openshift_deployment_type | default(deployment_type) }}" - deployment_subtype: "{{ openshift_deployment_subtype | default(deployment_subtype) }}" + deployment_subtype: "{{ openshift_deployment_subtype | default(None) }}" cluster_id: "{{ openshift_cluster_id | default('default') }}" hostname: "{{ openshift_hostname | default(None) }}" ip: "{{ openshift_ip | default(None) }}" diff --git a/utils/src/ooinstall/openshift_ansible.py b/utils/src/ooinstall/openshift_ansible.py index 4bb5b0b9b..09dd1ebc4 100644 --- a/utils/src/ooinstall/openshift_ansible.py +++ b/utils/src/ooinstall/openshift_ansible.py @@ -25,9 +25,6 @@ VARIABLES_MAP = { 'variant_subtype': 'deployment_subtype', 'master_routingconfig_subdomain': 'openshift_master_default_subdomain', 'proxy_http': 'openshift_http_proxy', - 'variant_subtype': 'deployment_subtype', - 'master_routingconfig_subdomain':'openshift_master_default_subdomain', - 'proxy_http':'openshift_http_proxy', 'proxy_https': 'openshift_https_proxy', 'proxy_exclude_hosts': 'openshift_no_proxy', } diff --git a/utils/src/ooinstall/variants.py b/utils/src/ooinstall/variants.py index 11817c00e..8f82655fd 100644 --- a/utils/src/ooinstall/variants.py +++ b/utils/src/ooinstall/variants.py @@ -45,9 +45,9 @@ OSE = Variant('openshift-enterprise', 'OpenShift Container Platform', ) REG = Variant('openshift-enterprise', 'Registry', - [ - Version('3.2', 'openshift-enterprise', 'registry'), - ] + [ + Version('3.2', 'openshift-enterprise', 'registry'), + ] ) origin = Variant('origin', 'OpenShift Origin', -- cgit v1.2.3