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. --- roles/cockpit-ui/meta/main.yml | 13 +++++++++++++ roles/cockpit-ui/tasks/main.yml | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 roles/cockpit-ui/meta/main.yml create mode 100644 roles/cockpit-ui/tasks/main.yml (limited to 'roles/cockpit-ui') diff --git a/roles/cockpit-ui/meta/main.yml b/roles/cockpit-ui/meta/main.yml new file mode 100644 index 000000000..6ad2e324a --- /dev/null +++ b/roles/cockpit-ui/meta/main.yml @@ -0,0 +1,13 @@ +--- +galaxy_info: + author: Samuel Munilla + description: Deploy and Enable cockpit-ui + company: Red Hat, Inc. + license: Apache License, Version 2.0 + min_ansible_version: 2.1 + platforms: + - name: EL + versions: + - 7 + categories: + - cloud diff --git a/roles/cockpit-ui/tasks/main.yml b/roles/cockpit-ui/tasks/main.yml new file mode 100644 index 000000000..1fa289653 --- /dev/null +++ b/roles/cockpit-ui/tasks/main.yml @@ -0,0 +1,19 @@ +--- +- name: Expose registry with route + command: oc expose service docker-registry + +- name: Install Cockpit template + command: oc create -f registry-console.yaml -n default + +- name: Create passthrough route for Registry + command: oc create route passthrough --service registry-console --port registry-console -n default + +- 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: Enable cockpit-ui + service: + name: cockpit.socket + enabled: true + state: started + when: not openshift.common.is_containerized | 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. --- roles/cockpit-ui/tasks/main.yml | 48 ++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 8 deletions(-) (limited to 'roles/cockpit-ui') 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 --- roles/cockpit-ui/tasks/main.yml | 7 ------- 1 file changed, 7 deletions(-) (limited to 'roles/cockpit-ui') 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 -- cgit v1.2.3