Browse Source

Merge pull request #9447 from mgugino-upstream-stage/fix-reg-console

Refactor registry-console template and vars
OpenShift Merge Robot 6 years ago
parent
commit
9b5eb1422c

+ 0 - 3
playbooks/common/openshift-cluster/upgrades/post_control_plane.yml

@@ -34,13 +34,10 @@
   # create and update in one step.
   - role: openshift_examples
     when: openshift_install_examples | default(true) | bool
-  - openshift_hosted_templates
   # Update the existing templates
   - role: openshift_examples
     when: openshift_install_examples | default(true) | bool
     openshift_examples_import_command: replace
-  - role: openshift_hosted_templates
-    openshift_hosted_templates_import_command: replace
 
 # Poll for registry and router pods, redeploy registry certs if needed.
 - import_playbook: ../../../openshift-hosted/private/upgrade_poll_and_check_certs.yml

+ 0 - 1
playbooks/openshift-master/private/additional_config.yml

@@ -30,7 +30,6 @@
     when: openshift_install_examples | default(true) | bool
   - role: openshift_cluster_autoscaler
     when: openshift_cluster_autoscaler_deploy | default(false) | bool
-  - role: openshift_hosted_templates
   - role: openshift_manageiq
     when: openshift_use_manageiq | default(true) | bool
   - role: cockpit

+ 18 - 1
roles/cockpit-ui/defaults/main.yml

@@ -1,2 +1,19 @@
 ---
-openshift_config_base: "/etc/origin"
+l_os_cockpit_image_version_dict:
+  origin: 'latest'
+  openshift-enterprise: "{{ openshift_image_tag }}"
+l_os_cockpit_image_version: "{{ l_os_cockpit_image_version_dict[openshift_deployment_type] }}"
+
+l_os_cockpit_image_format: "{{ l_os_non_standard_reg_url | regex_replace('${version}' | regex_escape, l_os_cockpit_image_version) }}"
+
+l_openshift_cockit_search_dict:
+  origin: "openshift/${component}"
+  openshift-enterprise: "ose-${component}"
+l_openshift_cockit_search: "{{ l_openshift_cockit_search_dict[openshift_deployment_type] }}"
+
+l_openshift_cockpit_replace_dict:
+  origin: "cockpit/kubernetes"
+  openshift-enterprise: "registry-console"
+l_openshift_cockpit_replace: "{{ l_openshift_cockpit_replace_dict[openshift_deployment_type] }}"
+
+openshift_cockpit_deployer_image: "{{ l_os_cockpit_image_format | regex_replace(l_openshift_cockit_search | regex_escape, l_openshift_cockpit_replace) }}"

+ 4 - 10
roles/openshift_hosted_templates/files/v3.10/origin/registry-console.yaml

@@ -29,7 +29,7 @@ objects:
             node-role.kubernetes.io/master: 'true'
           containers:
             - name: registry-console
-              image: ${IMAGE_PREFIX}${IMAGE_BASENAME}:${IMAGE_VERSION}
+              image: ${IMAGE_NAME}
               ports:
                 - containerPort: 9090
                   protocol: TCP
@@ -89,15 +89,9 @@ objects:
     redirectURIs:
       - "${COCKPIT_KUBE_URL}"
 parameters:
-  - description: 'Specify "registry/namespace" prefix for container image; e.g. for "registry.example.com/cockpit/kubernetes:latest", set prefix "registry.example.com/cockpit/"'
-    name: IMAGE_PREFIX
-    value: "cockpit/"
-  - description: 'Specify component name for container image; e.g. for "registry.example.com/cockpit/kubernetes:latest", use base name "kubernetes"'
-    name: IMAGE_BASENAME
-    value: "kubernetes"
-  - description: 'Specify image version; e.g. for "cockpit/kubernetes:latest", set version "latest"'
-    name: IMAGE_VERSION
-    value: latest
+  - description: 'Specify fully qualified image name and version; e.g. for "registry.access.redhat.com/openshift3/registry-console:v3.11"'
+    name: IMAGE_NAME
+    value: "openshift3/registry-console:latest"
   - description: "The public URL for the Openshift OAuth Provider, e.g. https://openshift.example.com:8443"
     name: OPENSHIFT_OAUTH_PROVIDER_URL
     required: true

+ 61 - 55
roles/cockpit-ui/tasks/main.yml

@@ -1,63 +1,69 @@
 ---
-- block:
+- name: Create local temp dir for registry-console template
+  command: mktemp -d /tmp/openshift-ansible-XXXXXXX
+  register: mktemp
+  # AUDIT:changed_when: not set here because this task actually
+  # creates something
 
-  # When openshift_hosted_manage_registry=true the openshift_hosted
-  # role will create the appropriate route for the docker-registry.
-  # When openshift_hosted_manage_registry=false then this code will
-  # not be run.
-  - name: fetch the docker-registry route
-    oc_route:
-      kubeconfig: "/etc/origin/master/admin.kubeconfig"
-      name: docker-registry
-      namespace: default
-      state: list
-    register: docker_registry_route
+- name: Copy the admin client config(s)
+  command: >
+    cp {{ openshift.common.config_base }}/master/admin.kubeconfig {{ mktemp.stdout }}/admin.kubeconfig
+  changed_when: False
 
-  - name: Create passthrough route for registry-console
-    oc_route:
-      kubeconfig: "/etc/origin/master/admin.kubeconfig"
-      name: registry-console
-      namespace: default
-      service_name: registry-console
-      state: present
-      tls_termination: passthrough
-    register: registry_console_cockpit_kube
+- name: Copy registry-console template to tmp dir
+  copy:
+    src: "registry-console.yaml"
+    dest: "{{ mktemp.stdout }}/registry-console.yaml"
 
-  # XXX: Required for items still using command
-  - name: Create temp directory for kubeconfig
-    command: mktemp -d /tmp/openshift-ansible-XXXXXX
-    register: mktemp
-    changed_when: False
+- name: Create registry-console template
+  command: >
+    {{ openshift_client_binary }} create
+    -f {{ mktemp.stdout }}/registry-console.yaml
+    --config={{ mktemp.stdout }}/admin.kubeconfig
+    -n openshift
+  register: oht_import_templates
+  failed_when: "'already exists' not in oht_import_templates.stderr and oht_import_templates.rc != 0"
+  changed_when: "'created' in oht_import_templates.stdout"
 
-  - set_fact:
-      openshift_hosted_kubeconfig: "{{ mktemp.stdout }}/admin.kubeconfig"
+# When openshift_hosted_manage_registry=true the openshift_hosted
+# role will create the appropriate route for the docker-registry.
+# When openshift_hosted_manage_registry=false then this code will
+# not be run.
+- name: fetch the docker-registry route
+  oc_route:
+    kubeconfig: "{{ mktemp.stdout }}/admin.kubeconfig"
+    name: docker-registry
+    namespace: default
+    state: list
+  register: docker_registry_route
 
-  - name: Copy the admin client config(s)
-    command: >
-      cp /etc/origin/master/admin.kubeconfig {{ openshift_hosted_kubeconfig }}
-    changed_when: False
+- name: Create passthrough route for registry-console
+  oc_route:
+    kubeconfig: "{{ mktemp.stdout }}/admin.kubeconfig"
+    name: registry-console
+    namespace: default
+    service_name: registry-console
+    state: present
+    tls_termination: passthrough
+  register: registry_console_cockpit_kube
 
-  - name: Deploy registry-console
-    command: >
-      {{ openshift_client_binary }} new-app --template=registry-console
-      {% if openshift_cockpit_deployer_prefix is defined  %}-p IMAGE_PREFIX="{{ openshift_cockpit_deployer_prefix }}"{% endif %}
-      {% if openshift_cockpit_deployer_basename is defined  %}-p IMAGE_BASENAME="{{ openshift_cockpit_deployer_basename }}"{% endif %}
-      {% if openshift_cockpit_deployer_version is defined  %}-p IMAGE_VERSION="{{ openshift_cockpit_deployer_version }}"{% endif %}
-      -p OPENSHIFT_OAUTH_PROVIDER_URL="{{ openshift.master.public_api_url }}"
-      -p REGISTRY_HOST="{{ docker_registry_route.results[0].spec.host }}"
-      -p COCKPIT_KUBE_URL="https://{{ registry_console_cockpit_kube.results.results[0].spec.host }}"
-      --config={{ openshift_hosted_kubeconfig }}
-      -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"
-    - "deploy_registry_console.rc != 0"
+- name: Deploy registry-console
+  command: >
+    {{ openshift_client_binary }} new-app --template=registry-console
+    -p IMAGE_NAME="{{ openshift_cockpit_deployer_image }}"
+    -p OPENSHIFT_OAUTH_PROVIDER_URL="{{ openshift.master.public_api_url }}"
+    -p REGISTRY_HOST="{{ docker_registry_route.results[0].spec.host }}"
+    -p COCKPIT_KUBE_URL="https://{{ registry_console_cockpit_kube.results.results[0].spec.host }}"
+    --config={{ mktemp.stdout }}/admin.kubeconfig
+    -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"
+  - "deploy_registry_console.rc != 0"
 
-  - name: Delete temp directory
-    file:
-      name: "{{ mktemp.stdout }}"
-      state: absent
-    changed_when: False
-    # XXX: End required for items still using command
-  run_once: true
+- name: Delete temp directory
+  file:
+    name: "{{ mktemp.stdout }}"
+    state: absent
+  changed_when: False

+ 3 - 1
roles/lib_utils/action_plugins/sanity_checks.py

@@ -66,7 +66,9 @@ REMOVED_VARIABLES = (
     ('oreg_auth_credentials_replace', 'Removed: Credentials are now always updated'),
     ('oreg_url_master', 'oreg_url'),
     ('oreg_url_node', 'oreg_url'),
-
+    ('openshift_cockpit_deployer_prefix', 'openshift_cockpit_deployer_image'),
+    ('openshift_cockpit_deployer_basename', 'openshift_cockpit_deployer_image'),
+    ('openshift_cockpit_deployer_version', 'openshift_cockpit_deployer_image'),
 )
 
 # JSON_FORMAT_VARIABLES does not intende to cover all json variables, but

+ 3 - 0
roles/openshift_facts/defaults/main.yml

@@ -15,6 +15,9 @@ l_oreg_host_temp: "{{ oreg_url | default(l_osm_registry_url_default) }}"
 # oreg_url is defined by user input.
 oreg_host: "{{ l_oreg_host_temp.split('/')[0] }}"
 
+# this variable does not replace ${version} with openshift_image_tag
+l_os_non_standard_reg_url: "{{ oreg_url | default(l_osm_registry_url_default) }}"
+
 l_docker_creds_image_dict:
   openshift-enterprise: 'openshift3/ose'
   origin: 'openshift/origin'

+ 0 - 14
roles/openshift_hosted_templates/defaults/main.yml

@@ -1,14 +0,0 @@
----
-hosted_base: "{{ openshift.common.config_base if openshift_is_containerized | bool else '/usr/share/openshift' }}/hosted"
-hosted_deployment_type: "{{ 'origin' if openshift_deployment_type == 'origin' else 'enterprise' }}"
-
-content_version: "{{ openshift_examples_content_version }}"
-
-openshift_hosted_images_dict:
-  origin: 'docker.io/openshift/origin-${component}:${version}'
-  openshift-enterprise: 'registry.redhat.io/openshift3/ose-${component}:${version}'
-
-openshift_hosted_templates_registryurl: "{{ oreg_url | default(openshift_hosted_images_dict[openshift_deployment_type]) | regex_replace('${version}' | regex_escape, openshift_image_tag | default('${version}')) }}"
-registry_host: "{{ openshift_hosted_templates_registryurl.split('/')[0] if '.' in openshift_hosted_templates_registryurl.split('/')[0] else '' }}"
-
-openshift_hosted_templates_import_command: 'create'

+ 0 - 116
roles/openshift_hosted_templates/files/v3.10/enterprise/registry-console.yaml

@@ -1,116 +0,0 @@
-kind: Template
-apiVersion: v1
-metadata:
-  name: "registry-console"
-  annotations:
-    description: "Template for deploying registry web console. Requires cluster-admin."
-    tags: infrastructure
-labels:
-  createdBy: "registry-console-template"
-objects:
-  - kind: DeploymentConfig
-    apiVersion: v1
-    metadata:
-      name: "registry-console"
-      labels:
-        name: "registry-console"
-    spec:
-      triggers:
-      - type: ConfigChange
-      replicas: 1
-      selector:
-        name: "registry-console"
-      template:
-        metadata:
-          labels:
-            name: "registry-console"
-        spec:
-          nodeSelector:
-            node-role.kubernetes.io/master: 'true'
-          containers:
-            - name: registry-console
-              image: ${IMAGE_PREFIX}${IMAGE_BASENAME}:${IMAGE_VERSION}
-              ports:
-                - containerPort: 9090
-                  protocol: TCP
-              livenessProbe:
-                failureThreshold: 3
-                httpGet:
-                  path: /ping
-                  port: 9090
-                  scheme: HTTP
-                initialDelaySeconds: 10
-                periodSeconds: 10
-                successThreshold: 1
-                timeoutSeconds: 5
-              readinessProbe:
-                failureThreshold: 3
-                httpGet:
-                  path: /ping
-                  port: 9090
-                  scheme: HTTP
-                periodSeconds: 10
-                successThreshold: 1
-                timeoutSeconds: 5
-              env:
-                - name: OPENSHIFT_OAUTH_PROVIDER_URL
-                  value: "${OPENSHIFT_OAUTH_PROVIDER_URL}"
-                - name: OPENSHIFT_OAUTH_CLIENT_ID
-                  value: "${OPENSHIFT_OAUTH_CLIENT_ID}"
-                - name: KUBERNETES_INSECURE
-                  value: "false"
-                - name: COCKPIT_KUBE_INSECURE
-                  value: "false"
-                - name: REGISTRY_ONLY
-                  value: "true"
-                - name: REGISTRY_HOST
-                  value: "${REGISTRY_HOST}"
-  - kind: Service
-    apiVersion: v1
-    metadata:
-     name: "registry-console"
-     labels:
-       name: "registry-console"
-    spec:
-      type: ClusterIP
-      ports:
-        - name: registry-console
-          protocol: TCP
-          port: 9000
-          targetPort: 9090
-      selector:
-        name: "registry-console"
-  - kind: OAuthClient
-    apiVersion: v1
-    metadata:
-      name: "${OPENSHIFT_OAUTH_CLIENT_ID}"
-      respondWithChallenges: false
-    secret: "${OPENSHIFT_OAUTH_CLIENT_SECRET}"
-    redirectURIs:
-      - "${COCKPIT_KUBE_URL}"
-parameters:
-  - description: 'Specify "registry/repository" prefix for container image; e.g. for "registry.access.redhat.com/openshift3/registry-console:latest", set prefix "registry.access.redhat.com/openshift3/"'
-    name: IMAGE_PREFIX
-    value: "registry.access.redhat.com/openshift3/"
-  - description: 'Specify component name for container image; e.g. for "registry.access.redhat.com/openshift3/registry-console:latest", use base name "registry-console"'
-    name: IMAGE_BASENAME
-    value: "registry-console"
-  - description: 'Specify image version; e.g. for "registry.access.redhat.com/openshift3/registry-console:v3.10", set version "v3.10"'
-    name: IMAGE_VERSION
-    value: "v3.10"
-  - description: "The public URL for the Openshift OAuth Provider, e.g. https://openshift.example.com:8443"
-    name: OPENSHIFT_OAUTH_PROVIDER_URL
-    required: true
-  - description: "The registry console URL. This should be created beforehand using 'oc create route passthrough --service registry-console --port registry-console -n default', e.g. https://registry-console-default.example.com"
-    name: COCKPIT_KUBE_URL
-    required: true
-  - description: "Oauth client secret"
-    name: OPENSHIFT_OAUTH_CLIENT_SECRET
-    from: "user[a-zA-Z0-9]{64}"
-    generate: expression
-  - description: "Oauth client id"
-    name: OPENSHIFT_OAUTH_CLIENT_ID
-    value: "cockpit-oauth-client"
-  - description: "The integrated registry hostname exposed via route, e.g. registry.example.com"
-    name: REGISTRY_HOST
-    required: true

+ 0 - 114
roles/openshift_hosted_templates/files/v3.11/enterprise/registry-console.yaml

@@ -1,114 +0,0 @@
-kind: Template
-apiVersion: v1
-metadata:
-  name: "registry-console"
-  annotations:
-    description: "Template for deploying registry web console. Requires cluster-admin."
-    tags: infrastructure
-labels:
-  createdBy: "registry-console-template"
-objects:
-  - kind: DeploymentConfig
-    apiVersion: v1
-    metadata:
-      name: "registry-console"
-      labels:
-        name: "registry-console"
-    spec:
-      triggers:
-      - type: ConfigChange
-      replicas: 1
-      selector:
-        name: "registry-console"
-      template:
-        metadata:
-          labels:
-            name: "registry-console"
-        spec:
-          containers:
-            - name: registry-console
-              image: ${IMAGE_PREFIX}${IMAGE_BASENAME}:${IMAGE_VERSION}
-              ports:
-                - containerPort: 9090
-                  protocol: TCP
-              livenessProbe:
-                failureThreshold: 3
-                httpGet:
-                  path: /ping
-                  port: 9090
-                  scheme: HTTP
-                initialDelaySeconds: 10
-                periodSeconds: 10
-                successThreshold: 1
-                timeoutSeconds: 5
-              readinessProbe:
-                failureThreshold: 3
-                httpGet:
-                  path: /ping
-                  port: 9090
-                  scheme: HTTP
-                periodSeconds: 10
-                successThreshold: 1
-                timeoutSeconds: 5
-              env:
-                - name: OPENSHIFT_OAUTH_PROVIDER_URL
-                  value: "${OPENSHIFT_OAUTH_PROVIDER_URL}"
-                - name: OPENSHIFT_OAUTH_CLIENT_ID
-                  value: "${OPENSHIFT_OAUTH_CLIENT_ID}"
-                - name: KUBERNETES_INSECURE
-                  value: "false"
-                - name: COCKPIT_KUBE_INSECURE
-                  value: "false"
-                - name: REGISTRY_ONLY
-                  value: "true"
-                - name: REGISTRY_HOST
-                  value: "${REGISTRY_HOST}"
-  - kind: Service
-    apiVersion: v1
-    metadata:
-     name: "registry-console"
-     labels:
-       name: "registry-console"
-    spec:
-      type: ClusterIP
-      ports:
-        - name: registry-console
-          protocol: TCP
-          port: 9000
-          targetPort: 9090
-      selector:
-        name: "registry-console"
-  - kind: OAuthClient
-    apiVersion: v1
-    metadata:
-      name: "${OPENSHIFT_OAUTH_CLIENT_ID}"
-      respondWithChallenges: false
-    secret: "${OPENSHIFT_OAUTH_CLIENT_SECRET}"
-    redirectURIs:
-      - "${COCKPIT_KUBE_URL}"
-parameters:
-  - description: 'Specify "registry/repository" prefix for container image; e.g. for "registry.access.redhat.com/openshift3/registry-console:latest", set prefix "registry.access.redhat.com/openshift3/"'
-    name: IMAGE_PREFIX
-    value: "registry.access.redhat.com/openshift3/"
-  - description: 'Specify component name for container image; e.g. for "registry.access.redhat.com/openshift3/registry-console:latest", use base name "registry-console"'
-    name: IMAGE_BASENAME
-    value: "registry-console"
-  - description: 'Specify image version; e.g. for "registry.access.redhat.com/openshift3/registry-console:v3.10", set version "v3.10"'
-    name: IMAGE_VERSION
-    value: "v3.11"
-  - description: "The public URL for the Openshift OAuth Provider, e.g. https://openshift.example.com:8443"
-    name: OPENSHIFT_OAUTH_PROVIDER_URL
-    required: true
-  - description: "The registry console URL. This should be created beforehand using 'oc create route passthrough --service registry-console --port registry-console -n default', e.g. https://registry-console-default.example.com"
-    name: COCKPIT_KUBE_URL
-    required: true
-  - description: "Oauth client secret"
-    name: OPENSHIFT_OAUTH_CLIENT_SECRET
-    from: "user[a-zA-Z0-9]{64}"
-    generate: expression
-  - description: "Oauth client id"
-    name: OPENSHIFT_OAUTH_CLIENT_ID
-    value: "cockpit-oauth-client"
-  - description: "The integrated registry hostname exposed via route, e.g. registry.example.com"
-    name: REGISTRY_HOST
-    required: true

+ 0 - 114
roles/openshift_hosted_templates/files/v3.11/origin/registry-console.yaml

@@ -1,114 +0,0 @@
-kind: Template
-apiVersion: v1
-metadata:
-  name: "registry-console"
-  annotations:
-    description: "Template for deploying registry web console. Requires cluster-admin."
-    tags: infrastructure
-labels:
-  createdBy: "registry-console-template"
-objects:
-  - kind: DeploymentConfig
-    apiVersion: v1
-    metadata:
-      name: "registry-console"
-      labels:
-        name: "registry-console"
-    spec:
-      triggers:
-      - type: ConfigChange
-      replicas: 1
-      selector:
-        name: "registry-console"
-      template:
-        metadata:
-          labels:
-            name: "registry-console"
-        spec:
-          containers:
-            - name: registry-console
-              image: ${IMAGE_PREFIX}${IMAGE_BASENAME}:${IMAGE_VERSION}
-              ports:
-                - containerPort: 9090
-                  protocol: TCP
-              livenessProbe:
-                failureThreshold: 3
-                httpGet:
-                  path: /ping
-                  port: 9090
-                  scheme: HTTP
-                initialDelaySeconds: 10
-                periodSeconds: 10
-                successThreshold: 1
-                timeoutSeconds: 5
-              readinessProbe:
-                failureThreshold: 3
-                httpGet:
-                  path: /ping
-                  port: 9090
-                  scheme: HTTP
-                periodSeconds: 10
-                successThreshold: 1
-                timeoutSeconds: 5
-              env:
-                - name: OPENSHIFT_OAUTH_PROVIDER_URL
-                  value: "${OPENSHIFT_OAUTH_PROVIDER_URL}"
-                - name: OPENSHIFT_OAUTH_CLIENT_ID
-                  value: "${OPENSHIFT_OAUTH_CLIENT_ID}"
-                - name: KUBERNETES_INSECURE
-                  value: "false"
-                - name: COCKPIT_KUBE_INSECURE
-                  value: "false"
-                - name: REGISTRY_ONLY
-                  value: "true"
-                - name: REGISTRY_HOST
-                  value: "${REGISTRY_HOST}"
-  - kind: Service
-    apiVersion: v1
-    metadata:
-     name: "registry-console"
-     labels:
-       name: "registry-console"
-    spec:
-      type: ClusterIP
-      ports:
-        - name: registry-console
-          protocol: TCP
-          port: 9000
-          targetPort: 9090
-      selector:
-        name: "registry-console"
-  - kind: OAuthClient
-    apiVersion: v1
-    metadata:
-      name: "${OPENSHIFT_OAUTH_CLIENT_ID}"
-      respondWithChallenges: false
-    secret: "${OPENSHIFT_OAUTH_CLIENT_SECRET}"
-    redirectURIs:
-      - "${COCKPIT_KUBE_URL}"
-parameters:
-  - description: 'Specify "registry/namespace" prefix for container image; e.g. for "registry.example.com/cockpit/kubernetes:latest", set prefix "registry.example.com/cockpit/"'
-    name: IMAGE_PREFIX
-    value: "cockpit/"
-  - description: 'Specify component name for container image; e.g. for "registry.example.com/cockpit/kubernetes:latest", use base name "kubernetes"'
-    name: IMAGE_BASENAME
-    value: "kubernetes"
-  - description: 'Specify image version; e.g. for "cockpit/kubernetes:latest", set version "latest"'
-    name: IMAGE_VERSION
-    value: latest
-  - description: "The public URL for the Openshift OAuth Provider, e.g. https://openshift.example.com:8443"
-    name: OPENSHIFT_OAUTH_PROVIDER_URL
-    required: true
-  - description: "The registry console URL. This should be created beforehand using 'oc create route passthrough --service registry-console --port registry-console -n default', e.g. https://registry-console-default.example.com"
-    name: COCKPIT_KUBE_URL
-    required: true
-  - description: "Oauth client secret"
-    name: OPENSHIFT_OAUTH_CLIENT_SECRET
-    from: "user[a-zA-Z0-9]{64}"
-    generate: expression
-  - description: "Oauth client id"
-    name: OPENSHIFT_OAUTH_CLIENT_ID
-    value: "cockpit-oauth-client"
-  - description: "The integrated registry hostname exposed via route, e.g. registry.example.com"
-    name: REGISTRY_HOST
-    required: true

+ 0 - 16
roles/openshift_hosted_templates/meta/main.yml

@@ -1,16 +0,0 @@
----
-galaxy_info:
-  author: Andrew Butcher
-  description: OpenShift Hosted Templates
-  company: Red Hat, Inc.
-  license: Apache License, Version 2.0
-  min_ansible_version: 2.1
-  platforms:
-  - name: EL
-    versions:
-    - 7
-  categories:
-  - cloud
-dependencies:
-- role: lib_utils
-- role: openshift_facts

+ 0 - 21
roles/openshift_hosted_templates/sync-templates.sh

@@ -1,21 +0,0 @@
-#!/bin/bash
-
-# Utility script to update the ansible repo with the latest templates for
-# metrics and logging
-#
-# This script should be run from
-# openshift-ansible/roles/openshift_hosted_templates
-
-ORIGIN_VERSION=v1.4
-EXAMPLES_BASE=$(pwd)/files/${ORIGIN_VERSION}
-find ${EXAMPLES_BASE} -name '*.json' -delete
-TEMP=`mktemp -d`
-pushd $TEMP
-
-wget https://raw.githubusercontent.com/openshift/origin-metrics/master/metrics.yaml                            -O ${EXAMPLES_BASE}/origin/metrics-deployer.yaml
-wget https://raw.githubusercontent.com/openshift/origin-metrics/enterprise/metrics.yaml                        -O ${EXAMPLES_BASE}/enterprise/metrics-deployer.yaml
-wget https://raw.githubusercontent.com/openshift/origin-aggregated-logging/master/deployer/deployer.yaml     -O ${EXAMPLES_BASE}/origin/logging-deployer.yaml
-wget https://raw.githubusercontent.com/openshift/origin-aggregated-logging/enterprise/deployment/deployer.yaml -O ${EXAMPLES_BASE}/enterprise/logging-deployer.yaml
-
-popd
-git diff files

+ 0 - 71
roles/openshift_hosted_templates/tasks/main.yml

@@ -1,71 +0,0 @@
----
-- name: Create local temp dir for OpenShift hosted templates copy
-  local_action: command mktemp -d /tmp/openshift-ansible-XXXXXXX
-  register: copy_hosted_templates_mktemp
-  run_once: True
-  # AUDIT:changed_when: not set here because this task actually
-  # creates something
-
-- name: Chmod local temp dir for OpenShift examples copy
-  local_action: command chmod 777 "{{ copy_hosted_templates_mktemp.stdout }}"
-  run_once: True
-
-- name: Create tar of OpenShift examples
-  local_action: command tar -C "{{ role_path }}/files/{{ content_version }}/{{ hosted_deployment_type }}" -cvf "{{ copy_hosted_templates_mktemp.stdout }}/openshift-hosted-templates.tar" .
-  args:
-    # Disables the following warning:
-    # Consider using unarchive module rather than running tar
-    warn: no
-
-- name: Chmod local tar of OpenShift examples
-  local_action: command chmod 744 "{{ copy_hosted_templates_mktemp.stdout }}/openshift-hosted-templates.tar"
-  run_once: True
-
-- name: Create remote OpenShift hosted templates directory
-  file:
-    dest: "{{ hosted_base }}"
-    state: directory
-    mode: 0755
-
-- name: Unarchive the OpenShift hosted templates on the remote
-  unarchive:
-    src: "{{ copy_hosted_templates_mktemp.stdout }}/openshift-hosted-templates.tar"
-    dest: "{{ hosted_base }}/"
-
-- name: Cleanup the OpenShift hosted templates temp dir
-  local_action: file dest="{{ copy_hosted_templates_mktemp.stdout }}" state=absent
-
-- name: Modify registry paths if registry_url is not registry.redhat.io
-  shell: >
-    find {{ hosted_base }} -type f | xargs -n 1 sed -i 's|registry.redhat.io|{{ registry_host | quote }}|g'
-  when: registry_host != '' and openshift_hosted_modify_imagestreams | default(openshift_examples_modify_imagestreams | default(False)) | bool
-
-- name: Create temp directory for kubeconfig
-  command: mktemp -d /tmp/openshift-ansible-XXXXXX
-  register: mktemp
-  changed_when: False
-
-- name: Record kubeconfig tmp dir
-  set_fact:
-    openshift_hosted_templates_kubeconfig: "{{ mktemp.stdout }}/admin.kubeconfig"
-
-- name: Copy the admin client config(s)
-  command: >
-    cp {{ openshift.common.config_base }}/master/admin.kubeconfig {{ openshift_hosted_templates_kubeconfig }}
-  changed_when: False
-
-- name: Create or update hosted templates
-  command: >
-    {{ openshift_client_binary }} {{ openshift_hosted_templates_import_command }}
-    -f {{ hosted_base }}
-    --config={{ openshift_hosted_templates_kubeconfig }}
-    -n openshift
-  register: oht_import_templates
-  failed_when: "'already exists' not in oht_import_templates.stderr and oht_import_templates.rc != 0"
-  changed_when: "'created' in oht_import_templates.stdout"
-
-- name: Delete temp directory
-  file:
-    name: "{{ mktemp.stdout }}"
-    state: absent
-  changed_when: False

+ 1 - 4
roles/openshift_logging_defaults/defaults/main.yml

@@ -4,9 +4,6 @@ l_openshift_logging_search_dict:
   openshift-enterprise: "ose-${component}"
 l_openshift_logging_search: "{{ l_openshift_logging_search_dict[openshift_deployment_type] }}"
 
-# this variable does not replace ${version} with openshift_image_tag
-l_os_logging_non_standard_reg_url: "{{ oreg_url | default(l_osm_registry_url_default) }}"
-
 l_os_logging_non_standard_reg_search_dict:
   origin: "origin-${component}"
   openshift-enterprise: "ose-${component}"
@@ -18,7 +15,7 @@ l_os_logging_proxy_image_version_dict:
 l_os_logging_proxy_image_version: "{{ l_os_logging_proxy_image_version_dict[openshift_deployment_type] }}"
 
 # We need to regex_replace ${version} with either v1.0.0 or openshift_image_tag
-l_os_logging_proxy_image: "{{ l_os_logging_non_standard_reg_url | regex_replace('${version}' | regex_escape, l_os_logging_proxy_image_version) }}"
+l_os_logging_proxy_image: "{{ l_os_non_standard_reg_url | regex_replace('${version}' | regex_escape, l_os_logging_proxy_image_version) }}"
 # We need to regex_replace the origin-${component} with 'oauth-proxy'
 l2_os_logging_proxy_image: "{{ l_os_logging_proxy_image | regex_replace(l_os_logging_non_standard_reg_search | regex_escape, 'oauth-proxy') }}"
 

+ 4 - 4
roles/openshift_prometheus/defaults/main.yaml

@@ -19,19 +19,19 @@ l_openshift_prometheus_version_dict:
     node_exporter: "{{ openshift_image_tag }}"
 
 l_openshift_prometheus_alertmanager_version: "{{ l_openshift_prometheus_version_dict[openshift_deployment_type]['alert_manager'] }}"
-l_openshift_prometheus_alertmanager_image: "{{ l_os_logging_non_standard_reg_url | regex_replace('${version}' | regex_escape, l_openshift_prometheus_alertmanager_version) }}"
+l_openshift_prometheus_alertmanager_image: "{{ l_os_non_standard_reg_url | regex_replace('${version}' | regex_escape, l_openshift_prometheus_alertmanager_version) }}"
 openshift_prometheus_alertmanager_image: "{{ l_openshift_prometheus_alertmanager_image | regex_replace(l_os_logging_non_standard_reg_search | regex_escape, 'prometheus-alertmanager') }}"
 
 l_openshift_prometheus_alertbuffer_version: "{{ l_openshift_prometheus_version_dict[openshift_deployment_type]['alert_buffer'] }}"
-l_openshift_prometheus_alertbuffer_image: "{{ l_os_logging_non_standard_reg_url | regex_replace('${version}' | regex_escape, l_openshift_prometheus_alertbuffer_version) }}"
+l_openshift_prometheus_alertbuffer_image: "{{ l_os_non_standard_reg_url | regex_replace('${version}' | regex_escape, l_openshift_prometheus_alertbuffer_version) }}"
 openshift_prometheus_alertbuffer_image: "{{ l_openshift_prometheus_alertbuffer_image | regex_replace(l_os_logging_non_standard_reg_search | regex_escape, 'prometheus-alert-buffer') }}"
 
 l_openshift_prometheus_node_exporter_version: "{{ l_openshift_prometheus_version_dict[openshift_deployment_type]['node_exporter'] }}"
-l_openshift_prometheus_node_exporter_image: "{{ l_os_logging_non_standard_reg_url | regex_replace('${version}' | regex_escape, l_openshift_prometheus_node_exporter_version) }}"
+l_openshift_prometheus_node_exporter_image: "{{ l_os_non_standard_reg_url | regex_replace('${version}' | regex_escape, l_openshift_prometheus_node_exporter_version) }}"
 openshift_prometheus_node_exporter_image: "{{ l_openshift_prometheus_node_exporter_image | regex_replace(l_os_logging_non_standard_reg_search | regex_escape, 'prometheus-node-exporter') }}"
 
 l_openshift_prometheus_version: "{{ l_openshift_prometheus_version_dict[openshift_deployment_type]['prometheus'] }}"
-l_openshift_prometheus_image: "{{ l_os_logging_non_standard_reg_url | regex_replace('${version}' | regex_escape, l_openshift_prometheus_version) }}"
+l_openshift_prometheus_image: "{{ l_os_non_standard_reg_url | regex_replace('${version}' | regex_escape, l_openshift_prometheus_version) }}"
 openshift_prometheus_image: "{{ l_openshift_prometheus_image | regex_replace(l_os_logging_non_standard_reg_search | regex_escape, 'prometheus') }}"
 
 openshift_prometheus_proxy_image: "{{ l2_os_logging_proxy_image }}"