Browse Source

Refactor logging image strings

This commit refactors the logging image variables to be inline
with other components in order to utilize oreg_url across
as many components as possible.
Michael Gugino 6 years ago
parent
commit
a310ad8600
71 changed files with 148 additions and 284 deletions
  1. 11 5
      inventory/hosts.example
  2. 1 1
      roles/etcd/defaults/main.yaml
  3. 3 0
      roles/openshift_grafana/defaults/main.yaml
  4. 1 0
      roles/openshift_grafana/meta/main.yml
  5. 0 7
      roles/openshift_grafana/tasks/main.yaml
  6. 2 2
      roles/openshift_grafana/templates/grafana.yml.j2
  7. 0 9
      roles/openshift_grafana/vars/default_images.yml
  8. 0 9
      roles/openshift_grafana/vars/openshift-enterprise.yml
  9. 0 14
      roles/openshift_logging/README.md
  10. 2 0
      roles/openshift_logging/defaults/main.yml
  11. 1 0
      roles/openshift_logging/meta/main.yaml
  12. 1 1
      roles/openshift_logging/templates/jks_pod.j2
  13. 4 0
      roles/openshift_logging_curator/defaults/main.yml
  14. 1 0
      roles/openshift_logging_curator/meta/main.yaml
  15. 0 13
      roles/openshift_logging_curator/tasks/main.yaml
  16. 1 1
      roles/openshift_logging_curator/templates/2.x/curator.j2
  17. 1 1
      roles/openshift_logging_curator/templates/5.x/curator-cj.j2
  18. 0 6
      roles/openshift_logging_curator/vars/default_images.yml
  19. 0 3
      roles/openshift_logging_curator/vars/openshift-enterprise.yml
  20. 26 0
      roles/openshift_logging_defaults/defaults/main.yml
  21. 7 0
      roles/openshift_logging_elasticsearch/defaults/main.yml
  22. 1 0
      roles/openshift_logging_elasticsearch/meta/main.yaml
  23. 0 15
      roles/openshift_logging_elasticsearch/tasks/main.yaml
  24. 2 2
      roles/openshift_logging_elasticsearch/templates/2.x/es.j2
  25. 2 2
      roles/openshift_logging_elasticsearch/templates/5.x/es.j2
  26. 0 8
      roles/openshift_logging_elasticsearch/vars/default_images.yml
  27. 0 5
      roles/openshift_logging_elasticsearch/vars/openshift-enterprise.yml
  28. 0 2
      roles/openshift_logging_eventrouter/README.md
  29. 2 0
      roles/openshift_logging_eventrouter/defaults/main.yaml
  30. 1 0
      roles/openshift_logging_eventrouter/meta/main.yaml
  31. 1 1
      roles/openshift_logging_eventrouter/tasks/install_eventrouter.yaml
  32. 0 13
      roles/openshift_logging_eventrouter/tasks/main.yaml
  33. 0 6
      roles/openshift_logging_eventrouter/vars/default_images.yml
  34. 0 3
      roles/openshift_logging_eventrouter/vars/openshift-enterprise.yml
  35. 1 0
      roles/openshift_logging_fluentd/meta/main.yaml
  36. 0 13
      roles/openshift_logging_fluentd/tasks/main.yaml
  37. 1 1
      roles/openshift_logging_fluentd/templates/2.x/fluentd.j2
  38. 1 1
      roles/openshift_logging_fluentd/templates/5.x/fluentd.j2
  39. 0 6
      roles/openshift_logging_fluentd/vars/default_images.yml
  40. 0 3
      roles/openshift_logging_fluentd/vars/openshift-enterprise.yml
  41. 5 0
      roles/openshift_logging_kibana/defaults/main.yml
  42. 1 0
      roles/openshift_logging_kibana/meta/main.yaml
  43. 0 14
      roles/openshift_logging_kibana/tasks/main.yaml
  44. 2 2
      roles/openshift_logging_kibana/templates/2.x/kibana.j2
  45. 2 2
      roles/openshift_logging_kibana/templates/5.x/kibana.j2
  46. 0 8
      roles/openshift_logging_kibana/vars/default_images.yml
  47. 0 5
      roles/openshift_logging_kibana/vars/openshift-enterprise.yml
  48. 2 0
      roles/openshift_logging_mux/defaults/main.yml
  49. 1 0
      roles/openshift_logging_mux/meta/main.yaml
  50. 1 14
      roles/openshift_logging_mux/tasks/main.yaml
  51. 0 6
      roles/openshift_logging_mux/vars/default_images.yml
  52. 0 3
      roles/openshift_logging_mux/vars/openshift-enterprise.yml
  53. 5 11
      roles/openshift_metrics/README.md
  54. 6 0
      roles/openshift_metrics/defaults/main.yaml
  55. 1 0
      roles/openshift_metrics/meta/main.yaml
  56. 0 11
      roles/openshift_metrics/tasks/main.yaml
  57. 1 1
      roles/openshift_metrics/templates/hawkular_cassandra_rc.j2
  58. 1 1
      roles/openshift_metrics/templates/hawkular_metrics_rc.j2
  59. 1 1
      roles/openshift_metrics/templates/hawkular_metrics_schema_job.j2
  60. 1 1
      roles/openshift_metrics/templates/hawkular_openshift_agent_ds.j2
  61. 1 1
      roles/openshift_metrics/templates/heapster.j2
  62. 0 3
      roles/openshift_metrics/vars/default_images.yml
  63. 0 3
      roles/openshift_metrics/vars/openshift-enterprise.yml
  64. 0 4
      roles/openshift_prometheus/README.md
  65. 35 0
      roles/openshift_prometheus/defaults/main.yaml
  66. 1 0
      roles/openshift_prometheus/meta/main.yaml
  67. 1 1
      roles/openshift_prometheus/tasks/install_node_exporter.yaml
  68. 0 5
      roles/openshift_prometheus/tasks/main.yaml
  69. 6 6
      roles/openshift_prometheus/templates/prometheus.j2
  70. 0 14
      roles/openshift_prometheus/vars/default_images.yml
  71. 0 14
      roles/openshift_prometheus/vars/openshift-enterprise.yml

+ 11 - 5
inventory/hosts.example

@@ -584,12 +584,18 @@ debug_level=2
 # Currently, you may only alter the hostname portion of the url, alterting the
 # Currently, you may only alter the hostname portion of the url, alterting the
 # `/hawkular/metrics` path will break installation of metrics.
 # `/hawkular/metrics` path will break installation of metrics.
 #openshift_metrics_hawkular_hostname=hawkular-metrics.example.com
 #openshift_metrics_hawkular_hostname=hawkular-metrics.example.com
-# Configure the prefix and version for the component images
-#openshift_metrics_image_prefix=docker.io/openshift/origin-
-#openshift_metrics_image_version=v3.9
+# Configure the metrics component images # Note, these will be modified by oreg_url by default
+#openshift_metrics_cassandra_image="docker.io/openshift/origin-metrics-cassandra:{{ openshift_image_tag }}"
+#openshift_metrics_hawkular_agent_image="docker.io/openshift/origin-metrics-hawkular-openshift-agent:{{ openshift_image_tag }}"
+#openshift_metrics_hawkular_metrics_image="docker.io/openshift/origin-metrics-hawkular-metrics:{{ openshift_image_tag }}"
+#openshift_metrics_schema_installer_image="docker.io/openshift/origin-metrics-schema-installer:{{ openshift_image_tag }}"
+#openshift_metrics_heapster_image="docker.io/openshift/origin-metrics-heapster:{{ openshift_image_tag }}"
 # when openshift_deployment_type=='openshift-enterprise'
 # when openshift_deployment_type=='openshift-enterprise'
-#openshift_metrics_image_prefix=registry.access.redhat.com/openshift3/
-#openshift_metrics_image_version=v3.9
+#openshift_metrics_cassandra_image="registry.access.redhat.com/openshift3/metrics-cassandra:{{ openshift_image_tag }}"
+#openshift_metrics_hawkular_agent_image="registry.access.redhat.com/openshift3/metrics-hawkular-openshift-agent:{{ openshift_image_tag }}"
+#openshift_metrics_hawkular_metrics_image="registry.access.redhat.com/openshift3/metrics-hawkular-metrics:{{ openshift_image_tag }}"
+#openshift_metrics_schema_installer_image="registry.access.redhat.com/openshift3/metrics-schema-installer:{{ openshift_image_tag }}"
+#openshift_metrics_heapster_image="registry.access.redhat.com/openshift3/metrics-heapster:{{ openshift_image_tag }}"
 #
 #
 # StorageClass
 # StorageClass
 # openshift_storageclass_name=gp2
 # openshift_storageclass_name=gp2

+ 1 - 1
roles/etcd/defaults/main.yaml

@@ -16,7 +16,7 @@ osm_etcd_image: "registry.access.redhat.com/rhel7/etcd:{{ r_etcd_upgrade_version
 etcd_image_dict:
 etcd_image_dict:
   origin: "quay.io/coreos/etcd:v{{ r_etcd_upgrade_version | default(r_etcd_default_version) }}"
   origin: "quay.io/coreos/etcd:v{{ r_etcd_upgrade_version | default(r_etcd_default_version) }}"
   openshift-enterprise: "{{ osm_etcd_image }}"
   openshift-enterprise: "{{ osm_etcd_image }}"
-etcd_image: "{{ etcd_image_dict[openshift_deployment_type | default('origin')] }}"
+etcd_image: "{{ etcd_image_dict[openshift_deployment_type] }}"
 
 
 # etcd run on a host => use etcdctl command directly
 # etcd run on a host => use etcdctl command directly
 # etcd run as a docker container => use docker exec
 # etcd run as a docker container => use docker exec

+ 3 - 0
roles/openshift_grafana/defaults/main.yaml

@@ -1,4 +1,7 @@
 ---
 ---
+# We should probably use something more official here.
+openshift_grafana_image: "docker.io/mrsiano/grafana-ocp:latest"
+openshift_grafana_proxy_image: "{{ l2_os_logging_proxy_image }}"
 
 
 openshift_grafana_state: present
 openshift_grafana_state: present
 openshift_grafana_namespace: openshift-grafana
 openshift_grafana_namespace: openshift-grafana

+ 1 - 0
roles/openshift_grafana/meta/main.yml

@@ -18,3 +18,4 @@ dependencies:
 - role: lib_openshift
 - role: lib_openshift
 - role: openshift_facts
 - role: openshift_facts
 - role: lib_utils
 - role: lib_utils
+- role: openshift_logging_defaults

+ 0 - 7
roles/openshift_grafana/tasks/main.yaml

@@ -1,11 +1,4 @@
 ---
 ---
-
-- name: Set default image variables based on openshift_deployment_type
-  include_vars: "{{ item }}"
-  with_first_found:
-    - "{{ openshift_deployment_type }}.yml"
-    - "default_images.yml"
-
 - name: Create temp directory for doing work in
 - name: Create temp directory for doing work in
   command: mktemp -d /tmp/openshift-grafana-ansible-XXXXXX
   command: mktemp -d /tmp/openshift-grafana-ansible-XXXXXX
   register: mktemp
   register: mktemp

+ 2 - 2
roles/openshift_grafana/templates/grafana.yml.j2

@@ -26,7 +26,7 @@ spec:
 {% endif %}
 {% endif %}
       containers:
       containers:
       - name: oauth-proxy
       - name: oauth-proxy
-        image: "{{ l_openshift_grafana_proxy_image_prefix }}oauth-proxy:{{ l_openshift_grafana_proxy_image_version }}"
+        image: "{{ openshift_grafana_proxy_image }}"
         imagePullPolicy: IfNotPresent
         imagePullPolicy: IfNotPresent
         resources:
         resources:
           requests:
           requests:
@@ -67,7 +67,7 @@ spec:
           name: grafana-proxy-secrets
           name: grafana-proxy-secrets
 
 
       - name: grafana
       - name: grafana
-        image: "{{ l_openshift_grafana_image_prefix }}{{ l_openshift_grafana_image }}:{{ l_openshift_grafana_image_version }}"
+        image: "{{ openshift_grafana_image }}"
         imagePullPolicy: IfNotPresent
         imagePullPolicy: IfNotPresent
         resources:
         resources:
           requests:
           requests:

+ 0 - 9
roles/openshift_grafana/vars/default_images.yml

@@ -1,9 +0,0 @@
----
-# image prefix defaults
-l_openshift_grafana_image_prefix: "{{ openshift_grafana_image_prefix | default('mrsiano/') }}"
-l_openshift_grafana_proxy_image_prefix: "{{ openshift_grafana_proxy_image_prefix | default('openshift/') }}"
-l_openshift_grafana_image: "{{ openshift_grafana_image| default('grafana-ocp') }}"
-
-# image version defaults
-l_openshift_grafana_image_version: "{{ openshift_grafana_image_version | default('latest') }}"
-l_openshift_grafana_proxy_image_version: "{{ openshift_grafana_proxy_image_version | default('v1.0.0') }}"

+ 0 - 9
roles/openshift_grafana/vars/openshift-enterprise.yml

@@ -1,9 +0,0 @@
----
-# image prefix defaults
-l_openshift_grafana_image_prefix: "{{ openshift_grafana_image_prefix | default('mrsiano/') }}"
-l_openshift_grafana_proxy_image_prefix: "{{ openshift_grafana_proxy_image_prefix | default('openshift/') }}"
-l_openshift_grafana_image: "{{ openshift_grafana_image| default('grafana-ocp') }}"
-
-# image version defaults
-l_openshift_grafana_image_version: "{{ openshift_grafana_image_version | default('latest') }}"
-l_openshift_grafana_proxy_image_version: "{{ openshift_grafana_proxy_image_version | default('v1.0.0') }}"

+ 0 - 14
roles/openshift_logging/README.md

@@ -20,20 +20,6 @@ When `openshift_logging_install_logging` is set to `False` the `openshift_loggin
 
 
 ### Optional vars:
 ### Optional vars:
 - `openshift_logging_purge_logging`: When `openshift_logging_install_logging` is set to 'False' to trigger uninstalation and `openshift_logging_purge_logging` is set to 'True', it will completely and irreversibly remove all logging persistent data including PVC. Defaults to 'False'.
 - `openshift_logging_purge_logging`: When `openshift_logging_install_logging` is set to 'False' to trigger uninstalation and `openshift_logging_purge_logging` is set to 'True', it will completely and irreversibly remove all logging persistent data including PVC. Defaults to 'False'.
-- `openshift_logging_image_prefix`: The prefix for the logging images to use. Defaults to 'docker.io/openshift/origin-'.
-- `openshift_logging_curator_image_prefix`: Setting the image prefix for Curator image. Defaults to `openshift_logging_image_prefix`.
-- `openshift_logging_elasticsearch_image_prefix`: Setting the image prefix for Elasticsearch image. Defaults to `openshift_logging_image_prefix`.
-- `openshift_logging_fluentd_image_prefix`: Setting the image prefix for Fluentd image. Defaults to `openshift_logging_image_prefix`.
-- `openshift_logging_kibana_image_prefix`: Setting the image prefix for Kibana image. Defaults to `openshift_logging_image_prefix`.
-- `openshift_logging_kibana_proxy_image_prefix`: Setting the image prefix for Kibana proxy image. Defaults to `openshift_logging_image_prefix`.
-- `openshift_logging_mux_image_prefix`: Setting the image prefix for Mux image. Defaults to `openshift_logging_image_prefix`.
-- `openshift_logging_image_version`: The image version for the logging images to use. Defaults to 'latest'.
-- `openshift_logging_curator_image_version`: Setting the image version for Curator image. Defaults to `openshift_logging_image_version`.
-- `openshift_logging_elasticsearch_image_version`: Setting the image version for Elasticsearch image. Defaults to `openshift_logging_image_version`.
-- `openshift_logging_fluentd_image_version`: Setting the image version for Fluentd image. Defaults to `openshift_logging_image_version`.
-- `openshift_logging_kibana_image_version`: Setting the image version for Kibana image. Defaults to `openshift_logging_image_version`.
-- `openshift_logging_kibana_proxy_image_version`: Setting the image version for Kibana proxy image. Defaults to `openshift_logging_image_version`.
-- `openshift_logging_mux_image_version`: Setting the image version for Mux image. Defaults to `openshift_logging_image_version`.
 - `openshift_logging_use_ops`: If 'True', set up a second ES and Kibana cluster for infrastructure logs. Defaults to 'False'.
 - `openshift_logging_use_ops`: If 'True', set up a second ES and Kibana cluster for infrastructure logs. Defaults to 'False'.
 - `openshift_logging_master_url`: The URL for the Kubernetes master, this does not need to be public facing but should be accessible from within the cluster. Defaults to 'https://kubernetes.default.svc.{{openshift.common.dns_domain}}'.
 - `openshift_logging_master_url`: The URL for the Kubernetes master, this does not need to be public facing but should be accessible from within the cluster. Defaults to 'https://kubernetes.default.svc.{{openshift.common.dns_domain}}'.
 - `openshift_logging_master_public_url`: The public facing URL for the Kubernetes master, this is used for Authentication redirection. Defaults to 'https://{{openshift.common.public_hostname}}:{{openshift_master_api_port}}'.
 - `openshift_logging_master_public_url`: The public facing URL for the Kubernetes master, this is used for Authentication redirection. Defaults to 'https://{{openshift.common.public_hostname}}:{{openshift_master_api_port}}'.

+ 2 - 0
roles/openshift_logging/defaults/main.yml

@@ -11,6 +11,8 @@ openshift_logging_install_logging: False
 openshift_logging_purge_logging: False
 openshift_logging_purge_logging: False
 openshift_logging_image_pull_secret: ""
 openshift_logging_image_pull_secret: ""
 
 
+openshift_logging_image: "{{ l_os_registry_url | regex_replace(l_openshift_logging_search | regex_escape, 'logging-deployer') }}"
+
 openshift_logging_es5_techpreview: False
 openshift_logging_es5_techpreview: False
 
 
 openshift_logging_curator_default_days: 30
 openshift_logging_curator_default_days: 30

+ 1 - 0
roles/openshift_logging/meta/main.yaml

@@ -15,3 +15,4 @@ dependencies:
 - role: lib_openshift
 - role: lib_openshift
 - role: openshift_facts
 - role: openshift_facts
 - role: lib_utils
 - role: lib_utils
+- role: openshift_logging_defaults

+ 1 - 1
roles/openshift_logging/templates/jks_pod.j2

@@ -7,7 +7,7 @@ metadata:
 spec:
 spec:
   containers:
   containers:
   - name: jks-cert-gen
   - name: jks-cert-gen
-    image: {{openshift_logging_image_prefix}}logging-deployer:{{openshift_logging_image_version}}
+    image: {{ openshift_logging_image }}
     imagePullPolicy: IfNotPresent
     imagePullPolicy: IfNotPresent
     command: ["sh",  "{{generated_certs_dir}}/generate-jks.sh"]
     command: ["sh",  "{{generated_certs_dir}}/generate-jks.sh"]
     securityContext:
     securityContext:

+ 4 - 0
roles/openshift_logging_curator/defaults/main.yml

@@ -3,6 +3,10 @@
 openshift_logging_curator_image_pull_secret: "{{ openshift_hosted_logging_image_pull_secret | default('') }}"
 openshift_logging_curator_image_pull_secret: "{{ openshift_hosted_logging_image_pull_secret | default('') }}"
 openshift_logging_curator_master_url: "https://kubernetes.default.svc.cluster.local"
 openshift_logging_curator_master_url: "https://kubernetes.default.svc.cluster.local"
 
 
+openshift_logging_es5_techpreview: False
+l_openshift_curator_image_replace: "{{ (openshift_logging_es5_techpreview | bool) | ternary('logging-curator5', 'logging-curator') }}"
+openshift_logging_curator_image: "{{ l_os_registry_url | regex_replace(l_openshift_logging_search | regex_escape, l_openshift_curator_image_replace) }}"
+
 openshift_logging_curator_namespace: logging
 openshift_logging_curator_namespace: logging
 
 
 ### Common settings
 ### Common settings

+ 1 - 0
roles/openshift_logging_curator/meta/main.yaml

@@ -15,3 +15,4 @@ dependencies:
 - role: lib_openshift
 - role: lib_openshift
 - role: openshift_facts
 - role: openshift_facts
 - role: lib_utils
 - role: lib_utils
+- role: openshift_logging_defaults

+ 0 - 13
roles/openshift_logging_curator/tasks/main.yaml

@@ -1,17 +1,4 @@
 ---
 ---
-- name: Set default image variables based on deployment_type
-  include_vars: "{{ var_file_name }}"
-  with_first_found:
-    - "{{ openshift_deployment_type }}.yml"
-    - "default_images.yml"
-  loop_control:
-    loop_var: var_file_name
-
-- name: Set curator image facts
-  set_fact:
-    openshift_logging_curator_image_prefix: "{{ openshift_logging_curator_image_prefix | default(__openshift_logging_curator_image_prefix) }}"
-    openshift_logging_curator_image_version: "{{ openshift_logging_curator_image_version | default(__openshift_logging_curator_image_version) }}"
-
 - name: Ensure that Logging Curator has nodes to run on
 - name: Ensure that Logging Curator has nodes to run on
   import_role:
   import_role:
     name: openshift_control_plane
     name: openshift_control_plane

+ 1 - 1
roles/openshift_logging_curator/templates/2.x/curator.j2

@@ -37,7 +37,7 @@ spec:
       containers:
       containers:
         -
         -
           name: "curator"
           name: "curator"
-          image: "{{openshift_logging_curator_image_prefix}}logging-curator:{{openshift_logging_curator_image_version}}"
+          image: "{{ openshift_logging_curator_image }}"
           imagePullPolicy: IfNotPresent
           imagePullPolicy: IfNotPresent
 {% if (curator_memory_limit is defined and curator_memory_limit is not none and curator_memory_limit != "") or (curator_cpu_limit is defined and curator_cpu_limit is not none and curator_cpu_limit != "") or (curator_cpu_request is defined and curator_cpu_request is not none and curator_cpu_request != "") %}
 {% if (curator_memory_limit is defined and curator_memory_limit is not none and curator_memory_limit != "") or (curator_cpu_limit is defined and curator_cpu_limit is not none and curator_cpu_limit != "") or (curator_cpu_request is defined and curator_cpu_request is not none and curator_cpu_request != "") %}
           resources:
           resources:

+ 1 - 1
roles/openshift_logging_curator/templates/5.x/curator-cj.j2

@@ -37,7 +37,7 @@ spec:
           containers:
           containers:
             -
             -
               name: "curator"
               name: "curator"
-              image: "{{openshift_logging_curator_image_prefix}}logging-curator5:{{openshift_logging_curator_image_version}}"
+              image: "{{ openshift_logging_curator_image }}"
               imagePullPolicy: IfNotPresent
               imagePullPolicy: IfNotPresent
 {% if (curator_memory_limit is defined and curator_memory_limit) or (curator_cpu_limit is defined and curator_cpu_limit) or (curator_cpu_request is defined and curator_cpu_request) %}
 {% if (curator_memory_limit is defined and curator_memory_limit) or (curator_cpu_limit is defined and curator_cpu_limit) or (curator_cpu_request is defined and curator_cpu_request) %}
               resources:
               resources:

+ 0 - 6
roles/openshift_logging_curator/vars/default_images.yml

@@ -1,6 +0,0 @@
----
-# unable to escape characters in here for some reason -- ideally would be '^[v]?\d\.\d+'
-__openshift_logging_image_tag: "{{ openshift_image_tag | regex_search('^[v]?[0-9].[0-9]+') }}"
-
-__openshift_logging_curator_image_prefix: "{{ openshift_logging_image_prefix | default('docker.io/openshift/origin-') }}"
-__openshift_logging_curator_image_version: "{{ openshift_logging_image_version | default(__openshift_logging_image_tag) }}"

+ 0 - 3
roles/openshift_logging_curator/vars/openshift-enterprise.yml

@@ -1,3 +0,0 @@
----
-__openshift_logging_curator_image_prefix: "{{ openshift_logging_image_prefix | default('registry.access.redhat.com/openshift3/') }}"
-__openshift_logging_curator_image_version: "{{ openshift_logging_image_version | default (openshift_image_tag) }}"

+ 26 - 0
roles/openshift_logging_defaults/defaults/main.yml

@@ -0,0 +1,26 @@
+---
+openshift_logging_es5_techpreview: False
+l_openshift_logging_search_dict:
+  origin: "${component}"
+  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}"
+l_os_logging_non_standard_reg_search: "{{ l_os_logging_non_standard_reg_search_dict[openshift_deployment_type] }}"
+
+l_os_logging_proxy_image_version_dict:
+  origin: 'v1.0.0'
+  openshift-enterprise: "{{ openshift_image_tag }}"
+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) }}"
+# 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') }}"
+
+openshift_logging_fluentd_image: "{{ l_os_registry_url | regex_replace(l_openshift_logging_search | regex_escape, 'logging-fluentd') }}"

+ 7 - 0
roles/openshift_logging_elasticsearch/defaults/main.yml

@@ -3,6 +3,13 @@
 openshift_logging_elasticsearch_image_pull_secret: "{{ openshift_hosted_logging_image_pull_secret | default('') }}"
 openshift_logging_elasticsearch_image_pull_secret: "{{ openshift_hosted_logging_image_pull_secret | default('') }}"
 openshift_logging_elasticsearch_namespace: logging
 openshift_logging_elasticsearch_namespace: logging
 
 
+
+l_openshift_elasticsearch_image_replace: "{{ (openshift_logging_es5_techpreview | bool) | ternary('logging-elasticsearch5', 'logging-elasticsearch') }}"
+openshift_logging_elasticsearch_image: "{{ l_os_registry_url | regex_replace(l_openshift_logging_search | regex_escape, l_openshift_elasticsearch_image_replace) }}"
+
+
+openshift_logging_elasticsearch_proxy_image: "{{ l2_os_logging_proxy_image }}"
+
 openshift_logging_elasticsearch_nodeselector: "{{ openshift_logging_es_nodeselector | default('') }}"
 openshift_logging_elasticsearch_nodeselector: "{{ openshift_logging_es_nodeselector | default('') }}"
 openshift_logging_elasticsearch_cpu_limit: null
 openshift_logging_elasticsearch_cpu_limit: null
 openshift_logging_elasticsearch_cpu_request: "{{ openshift_logging_es_cpu_request | default('1000m') }}"
 openshift_logging_elasticsearch_cpu_request: "{{ openshift_logging_es_cpu_request | default('1000m') }}"

+ 1 - 0
roles/openshift_logging_elasticsearch/meta/main.yaml

@@ -15,3 +15,4 @@ dependencies:
 - role: lib_openshift
 - role: lib_openshift
 - role: openshift_facts
 - role: openshift_facts
 - role: lib_utils
 - role: lib_utils
+- role: openshift_logging_defaults

+ 0 - 15
roles/openshift_logging_elasticsearch/tasks/main.yaml

@@ -23,21 +23,6 @@
     elasticsearch_name: "{{ 'logging-elasticsearch' ~ ( (openshift_logging_elasticsearch_ops_deployment | default(false) | bool) | ternary('-ops', '')) }}"
     elasticsearch_name: "{{ 'logging-elasticsearch' ~ ( (openshift_logging_elasticsearch_ops_deployment | default(false) | bool) | ternary('-ops', '')) }}"
     es_component: "{{ 'es' ~ ( (openshift_logging_elasticsearch_ops_deployment | default(false) | bool) | ternary('-ops', '') ) }}"
     es_component: "{{ 'es' ~ ( (openshift_logging_elasticsearch_ops_deployment | default(false) | bool) | ternary('-ops', '') ) }}"
 
 
-- name: Set default image variables based on openshift_deployment_type
-  include_vars: "{{ var_file_name }}"
-  with_first_found:
-  - "{{ openshift_deployment_type }}.yml"
-  - "default_images.yml"
-  loop_control:
-    loop_var: var_file_name
-
-- name: Set elasticsearch image facts
-  set_fact:
-    openshift_logging_elasticsearch_proxy_image_prefix: "{{ openshift_logging_elasticsearch_proxy_image_prefix | default(__openshift_logging_elasticsearch_proxy_image_prefix) }}"
-    openshift_logging_elasticsearch_proxy_image_version: "{{ openshift_logging_elasticsearch_proxy_image_version | default(__openshift_logging_elasticsearch_proxy_image_version) }}"
-    openshift_logging_elasticsearch_image_prefix: "{{ openshift_logging_elasticsearch_image_prefix | default(__openshift_logging_elasticsearch_image_prefix) }}"
-    openshift_logging_elasticsearch_image_version: "{{ openshift_logging_elasticsearch_image_version | default(__openshift_logging_elasticsearch_image_version) }}"
-
 - include_tasks: get_es_version.yml
 - include_tasks: get_es_version.yml
 
 
 - set_fact:
 - set_fact:

+ 2 - 2
roles/openshift_logging_elasticsearch/templates/2.x/es.j2

@@ -54,7 +54,7 @@ spec:
 {% endif %}
 {% endif %}
       containers:
       containers:
         - name: "elasticsearch"
         - name: "elasticsearch"
-          image: "{{ openshift_logging_elasticsearch_image_prefix }}logging-elasticsearch:{{ openshift_logging_elasticsearch_image_version }}"
+          image: "{{ openshift_logging_elasticsearch_image }}"
           imagePullPolicy: IfNotPresent
           imagePullPolicy: IfNotPresent
           resources:
           resources:
             limits:
             limits:
@@ -143,7 +143,7 @@ spec:
             periodSeconds: 5
             periodSeconds: 5
         -
         -
           name: proxy
           name: proxy
-          image: "{{ openshift_logging_elasticsearch_proxy_image_prefix }}oauth-proxy:{{ openshift_logging_elasticsearch_proxy_image_version }}"
+          image: "{{ openshift_logging_elasticsearch_proxy_image }}"
           imagePullPolicy: IfNotPresent
           imagePullPolicy: IfNotPresent
           args:
           args:
            - --upstream-ca=/etc/elasticsearch/secret/admin-ca
            - --upstream-ca=/etc/elasticsearch/secret/admin-ca

+ 2 - 2
roles/openshift_logging_elasticsearch/templates/5.x/es.j2

@@ -54,7 +54,7 @@ spec:
 {% endif %}
 {% endif %}
       containers:
       containers:
         - name: "elasticsearch"
         - name: "elasticsearch"
-          image: "{{ openshift_logging_elasticsearch_image_prefix }}logging-elasticsearch5:{{ openshift_logging_elasticsearch_image_version }}"
+          image: "{{ openshift_logging_elasticsearch_image }}"
           imagePullPolicy: IfNotPresent
           imagePullPolicy: IfNotPresent
           resources:
           resources:
             limits:
             limits:
@@ -151,7 +151,7 @@ spec:
             periodSeconds: 5
             periodSeconds: 5
         -
         -
           name: proxy
           name: proxy
-          image: "{{ openshift_logging_elasticsearch_proxy_image_prefix }}oauth-proxy:{{ openshift_logging_elasticsearch_proxy_image_version }}"
+          image: "{{ openshift_logging_elasticsearch_proxy_image }}"
           imagePullPolicy: IfNotPresent
           imagePullPolicy: IfNotPresent
           args:
           args:
            - --upstream-ca=/etc/elasticsearch/secret/admin-ca
            - --upstream-ca=/etc/elasticsearch/secret/admin-ca

+ 0 - 8
roles/openshift_logging_elasticsearch/vars/default_images.yml

@@ -1,8 +0,0 @@
----
-# unable to escape characters in here for some reason -- ideally would be '^[v]?\d\.\d+'
-__openshift_logging_image_tag: "{{ openshift_image_tag | regex_search('^[v]?[0-9].[0-9]+') }}"
-
-__openshift_logging_elasticsearch_image_prefix: "{{ openshift_logging_image_prefix | default('docker.io/openshift/origin-') }}"
-__openshift_logging_elasticsearch_image_version: "{{ openshift_logging_image_version | default(__openshift_logging_image_tag) }}"
-__openshift_logging_elasticsearch_proxy_image_prefix: "{{ openshift_logging_image_prefix | default('docker.io/openshift/') }}"
-__openshift_logging_elasticsearch_proxy_image_version: "{{ openshift_logging_image_version | default('v1.0.0') }}"

+ 0 - 5
roles/openshift_logging_elasticsearch/vars/openshift-enterprise.yml

@@ -1,5 +0,0 @@
----
-__openshift_logging_elasticsearch_image_prefix: "{{ openshift_logging_image_prefix | default('registry.access.redhat.com/openshift3/') }}"
-__openshift_logging_elasticsearch_image_version: "{{ openshift_logging_image_version | default (openshift_image_tag) }}"
-__openshift_logging_elasticsearch_proxy_image_prefix: "{{ openshift_logging_image_prefix | default('registry.access.redhat.com/openshift3/') }}"
-__openshift_logging_elasticsearch_proxy_image_version: "{{ openshift_logging_image_version | default (openshift_image_tag) }}"

+ 0 - 2
roles/openshift_logging_eventrouter/README.md

@@ -11,8 +11,6 @@ A pod forwarding kubernetes events to EFK aggregated logging stack.
 
 
 Configuration variables:
 Configuration variables:
 
 
-- `openshift_logging_eventrouter_image_prefix`: The prefix for the eventrouter logging image. Defaults to `openshift_logging_image_prefix`.
-- `openshift_logging_eventrouter_image_version`: The image version for the logging eventrouter. Defaults to 'latest'.
 - `openshift_logging_eventrouter_sink`: Select a sink for eventrouter, supported 'stdout' and 'glog'. Defaults to 'stdout'.
 - `openshift_logging_eventrouter_sink`: Select a sink for eventrouter, supported 'stdout' and 'glog'. Defaults to 'stdout'.
 - `openshift_logging_eventrouter_nodeselector`: A map of labels (e.g. {"node":"infra","region":"west"} to select the nodes where the pod will land.
 - `openshift_logging_eventrouter_nodeselector`: A map of labels (e.g. {"node":"infra","region":"west"} to select the nodes where the pod will land.
 - `openshift_logging_eventrouter_cpu_request`: The minimum amount of CPU to allocate to eventrouter. Defaults to '100m'.
 - `openshift_logging_eventrouter_cpu_request`: The minimum amount of CPU to allocate to eventrouter. Defaults to '100m'.

+ 2 - 0
roles/openshift_logging_eventrouter/defaults/main.yaml

@@ -6,3 +6,5 @@ openshift_logging_eventrouter_cpu_limit: null
 openshift_logging_eventrouter_cpu_request: 100m
 openshift_logging_eventrouter_cpu_request: 100m
 openshift_logging_eventrouter_memory_limit: 128Mi
 openshift_logging_eventrouter_memory_limit: 128Mi
 openshift_logging_eventrouter_namespace: default
 openshift_logging_eventrouter_namespace: default
+
+openshift_logging_eventrouter_image: "{{ l_os_registry_url | regex_replace(l_openshift_logging_search | regex_escape, 'logging-eventrouter') }}"

+ 1 - 0
roles/openshift_logging_eventrouter/meta/main.yaml

@@ -15,3 +15,4 @@ dependencies:
 - role: lib_openshift
 - role: lib_openshift
 - role: openshift_facts
 - role: openshift_facts
 - role: lib_utils
 - role: lib_utils
+- role: openshift_logging_defaults

+ 1 - 1
roles/openshift_logging_eventrouter/tasks/install_eventrouter.yaml

@@ -51,7 +51,7 @@
     template_name: eventrouter-template
     template_name: eventrouter-template
     namespace: "{{ openshift_logging_eventrouter_namespace }}"
     namespace: "{{ openshift_logging_eventrouter_namespace }}"
     params:
     params:
-      IMAGE: "{{openshift_logging_eventrouter_image_prefix}}logging-eventrouter:{{openshift_logging_eventrouter_image_version}}"
+      IMAGE: "{{ openshift_logging_eventrouter_image }}"
       REPLICAS: "{{ openshift_logging_eventrouter_replicas }}"
       REPLICAS: "{{ openshift_logging_eventrouter_replicas }}"
       CPU: "{{ openshift_logging_eventrouter_cpu_request }}"
       CPU: "{{ openshift_logging_eventrouter_cpu_request }}"
       MEMORY: "{{ openshift_logging_eventrouter_memory_limit }}"
       MEMORY: "{{ openshift_logging_eventrouter_memory_limit }}"

+ 0 - 13
roles/openshift_logging_eventrouter/tasks/main.yaml

@@ -1,17 +1,4 @@
 ---
 ---
-- name: Set default image variables based on openshift_deployment_type
-  include_vars: "{{ var_file_name }}"
-  with_first_found:
-    - "{{ openshift_deployment_type }}.yml"
-    - "default_images.yml"
-  loop_control:
-    loop_var: var_file_name
-
-- name: Set eventrouter image facts
-  set_fact:
-    openshift_logging_eventrouter_image_prefix: "{{ openshift_logging_eventrouter_image_prefix | default(__openshift_logging_eventrouter_image_prefix) }}"
-    openshift_logging_eventrouter_image_version: "{{ openshift_logging_eventrouter_image_version | default(__openshift_logging_eventrouter_image_version) }}"
-
 - include_tasks: install_eventrouter.yaml
 - include_tasks: install_eventrouter.yaml
   when: openshift_logging_install_eventrouter | default(false) | bool
   when: openshift_logging_install_eventrouter | default(false) | bool
 
 

+ 0 - 6
roles/openshift_logging_eventrouter/vars/default_images.yml

@@ -1,6 +0,0 @@
----
-# unable to escape characters in here for some reason -- ideally would be '^[v]?\d\.\d+'
-__openshift_logging_image_tag: "{{ openshift_image_tag | regex_search('^[v]?[0-9].[0-9]+') }}"
-
-__openshift_logging_eventrouter_image_prefix: "{{ openshift_logging_image_prefix | default('docker.io/openshift/origin-') }}"
-__openshift_logging_eventrouter_image_version: "{{ openshift_logging_image_version | default(__openshift_logging_image_tag) }}"

+ 0 - 3
roles/openshift_logging_eventrouter/vars/openshift-enterprise.yml

@@ -1,3 +0,0 @@
----
-__openshift_logging_eventrouter_image_prefix: "{{ openshift_logging_image_prefix | default('registry.access.redhat.com/openshift3/') }}"
-__openshift_logging_eventrouter_image_version: "{{ openshift_logging_image_version | default (openshift_image_tag) }}"

+ 1 - 0
roles/openshift_logging_fluentd/meta/main.yaml

@@ -15,3 +15,4 @@ dependencies:
 - role: lib_openshift
 - role: lib_openshift
 - role: openshift_facts
 - role: openshift_facts
 - role: lib_utils
 - role: lib_utils
+- role: openshift_logging_defaults

+ 0 - 13
roles/openshift_logging_fluentd/tasks/main.yaml

@@ -34,19 +34,6 @@
     msg: WARNING Use of openshift_logging_mux_client_mode=minimal is not recommended due to current scaling issues
     msg: WARNING Use of openshift_logging_mux_client_mode=minimal is not recommended due to current scaling issues
   when: openshift_logging_mux_client_mode is defined and openshift_logging_mux_client_mode == 'minimal'
   when: openshift_logging_mux_client_mode is defined and openshift_logging_mux_client_mode == 'minimal'
 
 
-- name: Set default image variables based on openshift_deployment_type
-  include_vars: "{{ var_file_name }}"
-  with_first_found:
-    - "{{ openshift_deployment_type }}.yml"
-    - "default_images.yml"
-  loop_control:
-    loop_var: var_file_name
-
-- name: Set fluentd image facts
-  set_fact:
-    openshift_logging_fluentd_image_prefix: "{{ openshift_logging_fluentd_image_prefix | default(__openshift_logging_fluentd_image_prefix) }}"
-    openshift_logging_fluentd_image_version: "{{ openshift_logging_fluentd_image_version | default(__openshift_logging_fluentd_image_version) }}"
-
 # allow passing in a tempdir
 # allow passing in a tempdir
 - name: Create temp directory for doing work in
 - name: Create temp directory for doing work in
   command: mktemp -d /tmp/openshift-logging-ansible-XXXXXX
   command: mktemp -d /tmp/openshift-logging-ansible-XXXXXX

+ 1 - 1
roles/openshift_logging_fluentd/templates/2.x/fluentd.j2

@@ -34,7 +34,7 @@ spec:
         {{ fluentd_nodeselector_key }}: "{{ fluentd_nodeselector_value }}"
         {{ fluentd_nodeselector_key }}: "{{ fluentd_nodeselector_value }}"
       containers:
       containers:
       - name: "{{ daemonset_container_name }}"
       - name: "{{ daemonset_container_name }}"
-        image: "{{ openshift_logging_fluentd_image_prefix }}logging-fluentd:{{ openshift_logging_fluentd_image_version }}"
+        image: "{{ openshift_logging_fluentd_image }}"
         imagePullPolicy: IfNotPresent
         imagePullPolicy: IfNotPresent
         securityContext:
         securityContext:
           privileged: true
           privileged: true

+ 1 - 1
roles/openshift_logging_fluentd/templates/5.x/fluentd.j2

@@ -34,7 +34,7 @@ spec:
         {{ fluentd_nodeselector_key }}: "{{ fluentd_nodeselector_value }}"
         {{ fluentd_nodeselector_key }}: "{{ fluentd_nodeselector_value }}"
       containers:
       containers:
       - name: "{{ daemonset_container_name }}"
       - name: "{{ daemonset_container_name }}"
-        image: "{{ openshift_logging_fluentd_image_prefix }}logging-fluentd:{{ openshift_logging_fluentd_image_version }}"
+        image: "{{ openshift_logging_fluentd_image }}"
         imagePullPolicy: IfNotPresent
         imagePullPolicy: IfNotPresent
         securityContext:
         securityContext:
           privileged: true
           privileged: true

+ 0 - 6
roles/openshift_logging_fluentd/vars/default_images.yml

@@ -1,6 +0,0 @@
----
-# unable to escape characters in here for some reason -- ideally would be '^[v]?\d\.\d+'
-__openshift_logging_image_tag: "{{ openshift_image_tag | regex_search('^[v]?[0-9].[0-9]+') }}"
-
-__openshift_logging_fluentd_image_prefix: "{{ openshift_logging_image_prefix | default('docker.io/openshift/origin-') }}"
-__openshift_logging_fluentd_image_version: "{{ openshift_logging_image_version | default(__openshift_logging_image_tag) }}"

+ 0 - 3
roles/openshift_logging_fluentd/vars/openshift-enterprise.yml

@@ -1,3 +0,0 @@
----
-__openshift_logging_fluentd_image_prefix: "{{ openshift_logging_image_prefix | default('registry.access.redhat.com/openshift3/') }}"
-__openshift_logging_fluentd_image_version: "{{ openshift_logging_image_version | default (openshift_image_tag) }}"

+ 5 - 0
roles/openshift_logging_kibana/defaults/main.yml

@@ -5,6 +5,11 @@ openshift_logging_kibana_master_public_url: "https://kubernetes.default.svc.clus
 openshift_logging_kibana_image_pull_secret: "{{ openshift_hosted_logging_image_pull_secret | default('') }}"
 openshift_logging_kibana_image_pull_secret: "{{ openshift_hosted_logging_image_pull_secret | default('') }}"
 openshift_logging_kibana_namespace: logging
 openshift_logging_kibana_namespace: logging
 
 
+openshift_logging_es5_techpreview: False
+l_openshift_kibana_image_replace: "{{ (openshift_logging_es5_techpreview | bool) | ternary('logging-kibana5', 'logging-kibana') }}"
+openshift_logging_kibana_image: "{{ l_os_registry_url | regex_replace(l_openshift_logging_search | regex_escape, l_openshift_kibana_image_replace) }}"
+openshift_logging_kibana_proxy_image: "{{ l_os_logging_proxy_image | regex_replace(l_os_logging_non_standard_reg_search | regex_escape, 'logging-auth-proxy') }}"
+
 openshift_logging_kibana_nodeselector: ""
 openshift_logging_kibana_nodeselector: ""
 openshift_logging_kibana_cpu_limit: null
 openshift_logging_kibana_cpu_limit: null
 openshift_logging_kibana_cpu_request: 100m
 openshift_logging_kibana_cpu_request: 100m

+ 1 - 0
roles/openshift_logging_kibana/meta/main.yaml

@@ -15,3 +15,4 @@ dependencies:
 - role: lib_openshift
 - role: lib_openshift
 - role: openshift_facts
 - role: openshift_facts
 - role: lib_utils
 - role: lib_utils
+- role: openshift_logging_defaults

+ 0 - 14
roles/openshift_logging_kibana/tasks/main.yaml

@@ -1,12 +1,5 @@
 ---
 ---
 # fail is we don't have an endpoint for ES to connect to?
 # fail is we don't have an endpoint for ES to connect to?
-- name: Set default image variables based on openshift_deployment_type
-  include_vars: "{{ var_file_name }}"
-  with_first_found:
-    - "{{ openshift_deployment_type }}.yml"
-    - "default_images.yml"
-  loop_control:
-    loop_var: var_file_name
 
 
 - name: Ensure that Kibana has nodes to run on
 - name: Ensure that Kibana has nodes to run on
   import_role:
   import_role:
@@ -16,13 +9,6 @@
     openshift_master_ensure_nodes_selector: "{{ openshift_logging_kibana_nodeselector | map_to_pairs }}"
     openshift_master_ensure_nodes_selector: "{{ openshift_logging_kibana_nodeselector | map_to_pairs }}"
     openshift_master_ensure_nodes_service: Kibana
     openshift_master_ensure_nodes_service: Kibana
 
 
-- name: Set kibana image facts
-  set_fact:
-    openshift_logging_kibana_image_prefix: "{{ openshift_logging_kibana_image_prefix | default(__openshift_logging_kibana_image_prefix) }}"
-    openshift_logging_kibana_image_version: "{{ openshift_logging_kibana_image_version | default(__openshift_logging_kibana_image_version) }}"
-    openshift_logging_kibana_proxy_image_prefix: "{{ openshift_logging_kibana_proxy_image_prefix | default(__openshift_logging_kibana_proxy_image_prefix) }}"
-    openshift_logging_kibana_proxy_image_version: "{{ openshift_logging_kibana_proxy_image_version | default(__openshift_logging_kibana_proxy_image_version) }}"
-
 # allow passing in a tempdir
 # allow passing in a tempdir
 - name: Create temp directory for doing work in
 - name: Create temp directory for doing work in
   command: mktemp -d /tmp/openshift-logging-ansible-XXXXXX
   command: mktemp -d /tmp/openshift-logging-ansible-XXXXXX

+ 2 - 2
roles/openshift_logging_kibana/templates/2.x/kibana.j2

@@ -48,7 +48,7 @@ spec:
       containers:
       containers:
         -
         -
           name: "kibana"
           name: "kibana"
-          image: "{{ openshift_logging_kibana_image_prefix }}logging-kibana:{{ openshift_logging_kibana_image_version }}"
+          image: "{{ openshift_logging_kibana_image }}"
           imagePullPolicy: IfNotPresent
           imagePullPolicy: IfNotPresent
 {% if (kibana_memory_limit is defined and kibana_memory_limit is not none and kibana_memory_limit != "") or (kibana_cpu_limit is defined and kibana_cpu_limit is not none and kibana_cpu_limit != "") or (kibana_cpu_request is defined and kibana_cpu_request is not none and kibana_cpu_request != "") %}
 {% if (kibana_memory_limit is defined and kibana_memory_limit is not none and kibana_memory_limit != "") or (kibana_cpu_limit is defined and kibana_cpu_limit is not none and kibana_cpu_limit != "") or (kibana_cpu_request is defined and kibana_cpu_request is not none and kibana_cpu_request != "") %}
           resources:
           resources:
@@ -99,7 +99,7 @@ spec:
             periodSeconds: 5
             periodSeconds: 5
         -
         -
           name: "kibana-proxy"
           name: "kibana-proxy"
-          image: "{{ openshift_logging_kibana_proxy_image_prefix }}logging-auth-proxy:{{ openshift_logging_kibana_proxy_image_version }}"
+          image: "{{ openshift_logging_kibana_proxy_image }}"
           imagePullPolicy: IfNotPresent
           imagePullPolicy: IfNotPresent
 {% if (kibana_proxy_memory_limit is defined and kibana_proxy_memory_limit is not none and kibana_proxy_memory_limit != "") or (kibana_proxy_cpu_limit is defined and kibana_proxy_cpu_limit is not none and kibana_proxy_cpu_limit != "") or (kibana_proxy_cpu_request is defined and kibana_proxy_cpu_request is not none and kibana_proxy_cpu_request != "") %}
 {% if (kibana_proxy_memory_limit is defined and kibana_proxy_memory_limit is not none and kibana_proxy_memory_limit != "") or (kibana_proxy_cpu_limit is defined and kibana_proxy_cpu_limit is not none and kibana_proxy_cpu_limit != "") or (kibana_proxy_cpu_request is defined and kibana_proxy_cpu_request is not none and kibana_proxy_cpu_request != "") %}
           resources:
           resources:

+ 2 - 2
roles/openshift_logging_kibana/templates/5.x/kibana.j2

@@ -48,7 +48,7 @@ spec:
       containers:
       containers:
         -
         -
           name: "kibana"
           name: "kibana"
-          image: "{{ openshift_logging_kibana_image_prefix }}logging-kibana5:{{ openshift_logging_kibana_image_version }}"
+          image: "{{ openshift_logging_kibana_image }}"
           imagePullPolicy: IfNotPresent
           imagePullPolicy: IfNotPresent
 {% if (kibana_memory_limit is defined and kibana_memory_limit is not none and kibana_memory_limit != "") or (kibana_cpu_limit is defined and kibana_cpu_limit is not none and kibana_cpu_limit != "") or (kibana_cpu_request is defined and kibana_cpu_request is not none and kibana_cpu_request != "") %}
 {% if (kibana_memory_limit is defined and kibana_memory_limit is not none and kibana_memory_limit != "") or (kibana_cpu_limit is defined and kibana_cpu_limit is not none and kibana_cpu_limit != "") or (kibana_cpu_request is defined and kibana_cpu_request is not none and kibana_cpu_request != "") %}
           resources:
           resources:
@@ -93,7 +93,7 @@ spec:
             periodSeconds: 5
             periodSeconds: 5
         -
         -
           name: "kibana-proxy"
           name: "kibana-proxy"
-          image: "{{ openshift_logging_kibana_proxy_image_prefix }}logging-auth-proxy:{{ openshift_logging_kibana_proxy_image_version }}"
+          image: "{{ openshift_logging_kibana_proxy_image }}"
           imagePullPolicy: IfNotPresent
           imagePullPolicy: IfNotPresent
 {% if (kibana_proxy_memory_limit is defined and kibana_proxy_memory_limit is not none and kibana_proxy_memory_limit != "") or (kibana_proxy_cpu_limit is defined and kibana_proxy_cpu_limit is not none and kibana_proxy_cpu_limit != "") or (kibana_proxy_cpu_request is defined and kibana_proxy_cpu_request is not none and kibana_proxy_cpu_request != "") %}
 {% if (kibana_proxy_memory_limit is defined and kibana_proxy_memory_limit is not none and kibana_proxy_memory_limit != "") or (kibana_proxy_cpu_limit is defined and kibana_proxy_cpu_limit is not none and kibana_proxy_cpu_limit != "") or (kibana_proxy_cpu_request is defined and kibana_proxy_cpu_request is not none and kibana_proxy_cpu_request != "") %}
           resources:
           resources:

+ 0 - 8
roles/openshift_logging_kibana/vars/default_images.yml

@@ -1,8 +0,0 @@
----
-# unable to escape characters in here for some reason -- ideally would be '^[v]?\d\.\d+'
-__openshift_logging_image_tag: "{{ openshift_image_tag | regex_search('^[v]?[0-9].[0-9]+') }}"
-
-__openshift_logging_kibana_image_prefix: "{{ openshift_logging_image_prefix | default('docker.io/openshift/origin-') }}"
-__openshift_logging_kibana_image_version: "{{ openshift_logging_image_version | default(__openshift_logging_image_tag) }}"
-__openshift_logging_kibana_proxy_image_prefix: "{{ openshift_logging_image_prefix | default('docker.io/openshift/origin-') }}"
-__openshift_logging_kibana_proxy_image_version: "{{ openshift_logging_image_version | default(__openshift_logging_image_tag) }}"

+ 0 - 5
roles/openshift_logging_kibana/vars/openshift-enterprise.yml

@@ -1,5 +0,0 @@
----
-__openshift_logging_kibana_image_prefix: "{{ openshift_logging_image_prefix | default('registry.access.redhat.com/openshift3/') }}"
-__openshift_logging_kibana_image_version: "{{ openshift_logging_image_version | default (openshift_image_tag) }}"
-__openshift_logging_kibana_proxy_image_prefix: "{{ openshift_logging_image_prefix | default('registry.access.redhat.com/openshift3/') }}"
-__openshift_logging_kibana_proxy_image_version: "{{ openshift_logging_image_version | default (openshift_image_tag) }}"

+ 2 - 0
roles/openshift_logging_mux/defaults/main.yml

@@ -5,6 +5,8 @@ openshift_logging_mux_master_url: "https://kubernetes.default.svc.{{ openshift.c
 openshift_logging_mux_master_public_url: "{{ openshift_hosted_logging_master_public_url | default('https://' + openshift.common.public_hostname + ':' ~ openshift_master_api_port) }}"
 openshift_logging_mux_master_public_url: "{{ openshift_hosted_logging_master_public_url | default('https://' + openshift.common.public_hostname + ':' ~ openshift_master_api_port) }}"
 openshift_logging_mux_namespace: logging
 openshift_logging_mux_namespace: logging
 
 
+openshift_logging_mux_image: "{{ openshift_logging_fluentd_image }}"
+
 ### Common settings
 ### Common settings
 # map_from_pairs is a custom filter plugin in role lib_utils
 # map_from_pairs is a custom filter plugin in role lib_utils
 openshift_logging_mux_nodeselector: "{{ openshift_hosted_logging_mux_nodeselector_label | default('') | map_from_pairs }}"
 openshift_logging_mux_nodeselector: "{{ openshift_hosted_logging_mux_nodeselector_label | default('') | map_from_pairs }}"

+ 1 - 0
roles/openshift_logging_mux/meta/main.yaml

@@ -15,3 +15,4 @@ dependencies:
 - role: lib_openshift
 - role: lib_openshift
 - role: openshift_facts
 - role: openshift_facts
 - role: lib_utils
 - role: lib_utils
+- role: openshift_logging_defaults

+ 1 - 14
roles/openshift_logging_mux/tasks/main.yaml

@@ -19,19 +19,6 @@
     openshift_master_ensure_nodes_selector: "{{ openshift_logging_mux_nodeselector | map_to_pairs }}"
     openshift_master_ensure_nodes_selector: "{{ openshift_logging_mux_nodeselector | map_to_pairs }}"
     openshift_master_ensure_nodes_service: Logging Mux
     openshift_master_ensure_nodes_service: Logging Mux
 
 
-- name: Set default image variables based on openshift_deployment_type
-  include_vars: "{{ var_file_name }}"
-  with_first_found:
-  - "{{ openshift_deployment_type }}.yml"
-  - "default_images.yml"
-  loop_control:
-    loop_var: var_file_name
-
-- name: Set mux image facts
-  set_fact:
-    openshift_logging_mux_image_prefix: "{{ openshift_logging_mux_image_prefix | default(__openshift_logging_mux_image_prefix) }}"
-    openshift_logging_mux_image_version: "{{ openshift_logging_mux_image_version | default(__openshift_logging_mux_image_version) }}"
-
 # allow passing in a tempdir
 # allow passing in a tempdir
 - name: Create temp directory for doing work in
 - name: Create temp directory for doing work in
   command: mktemp -d /tmp/openshift-logging-ansible-XXXXXX
   command: mktemp -d /tmp/openshift-logging-ansible-XXXXXX
@@ -186,7 +173,7 @@
     component: mux
     component: mux
     logging_component: mux
     logging_component: mux
     deploy_name: "logging-{{ component }}"
     deploy_name: "logging-{{ component }}"
-    image: "{{ openshift_logging_mux_image_prefix }}logging-fluentd:{{ openshift_logging_mux_image_version }}"
+    image: "{{ openshift_logging_mux_image }}"
     es_host: "{{ openshift_logging_mux_app_host }}"
     es_host: "{{ openshift_logging_mux_app_host }}"
     es_port: "{{ openshift_logging_mux_app_port }}"
     es_port: "{{ openshift_logging_mux_app_port }}"
     ops_host: "{{ openshift_logging_mux_ops_host }}"
     ops_host: "{{ openshift_logging_mux_ops_host }}"

+ 0 - 6
roles/openshift_logging_mux/vars/default_images.yml

@@ -1,6 +0,0 @@
----
-# unable to escape characters in here for some reason -- ideally would be '^[v]?\d\.\d+'
-__openshift_logging_image_tag: "{{ openshift_image_tag | regex_search('^[v]?[0-9].[0-9]+') }}"
-
-__openshift_logging_mux_image_prefix: "{{ openshift_logging_image_prefix | default('docker.io/openshift/origin-') }}"
-__openshift_logging_mux_image_version: "{{ openshift_logging_image_version | default(__openshift_logging_image_tag) }}"

+ 0 - 3
roles/openshift_logging_mux/vars/openshift-enterprise.yml

@@ -1,3 +0,0 @@
----
-__openshift_logging_mux_image_prefix: "{{ openshift_logging_image_prefix | default('registry.access.redhat.com/openshift3/') }}"
-__openshift_logging_mux_image_version: "{{ openshift_logging_image_version | default (openshift_image_tag) }}"

+ 5 - 11
roles/openshift_metrics/README.md

@@ -23,12 +23,6 @@ Role Variables
 
 
 For default values, see [`defaults/main.yaml`](defaults/main.yaml).
 For default values, see [`defaults/main.yaml`](defaults/main.yaml).
 
 
-- `openshift_metrics_image_prefix`: Specify prefix for metrics components; e.g for
-  "openshift/origin-metrics-deployer:v1.1", set prefix "openshift/origin-".
-
-- `openshift_metrics_image_version`: Specify version for metrics components; e.g. for
-  "openshift/origin-metrics-deployer:v1.1", set version "v1.1".
-
 - `openshift_metrics_hawkular_cert:` The certificate used for re-encrypting the route
 - `openshift_metrics_hawkular_cert:` The certificate used for re-encrypting the route
   to Hawkular metrics.  The certificate must contain the hostname used by the route.
   to Hawkular metrics.  The certificate must contain the hostname used by the route.
   The default router certificate will be used if unspecified
   The default router certificate will be used if unspecified
@@ -126,7 +120,7 @@ $ docker images
 REPOSITORY                                       TAG     IMAGE ID       CREATED             SIZE
 REPOSITORY                                       TAG     IMAGE ID       CREATED             SIZE
 <registry>/openshift3/origin-metrics-cassandra   v3.7    f8ad8d569e27   14 hours ago        783.7 MB
 <registry>/openshift3/origin-metrics-cassandra   v3.7    f8ad8d569e27   14 hours ago        783.7 MB
 
 
-$ docker inspect 9c3597aeb39f 
+$ docker inspect 9c3597aeb39f
 [
 [
     {
     {
         . . .
         . . .
@@ -139,7 +133,7 @@ $ docker inspect 9c3597aeb39f
             "Labels": {
             "Labels": {
                 . . .
                 . . .
                 "build-date": "2017-10-17T16:47:44.350655",
                 "build-date": "2017-10-17T16:47:44.350655",
-                . . . 
+                . . .
                 "release": "0.143.4.0",
                 "release": "0.143.4.0",
                 . . .
                 . . .
                 "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/openshift3/metrics-cassandra/images/v3.7.0-0.143.4.0",
                 "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/openshift3/metrics-cassandra/images/v3.7.0-0.143.4.0",
@@ -158,13 +152,13 @@ $ docker pull <registry>/openshift3/origin-metrics-cassandra:v3.7
 If there was an update, you need to run the `docker pull` on each node.
 If there was an update, you need to run the `docker pull` on each node.
 
 
 It is recommended that you now rerun the `openshift_metrics` playbook to ensure that any necessary config changes are also picked up.
 It is recommended that you now rerun the `openshift_metrics` playbook to ensure that any necessary config changes are also picked up.
- 
+
 To manually redeploy your pod you can do the following:
 To manually redeploy your pod you can do the following:
 - for a DC you can do:
 - for a DC you can do:
 ```
 ```
 oc rollout latest <dc_name>
 oc rollout latest <dc_name>
 ```
 ```
-     
+
 - for a RC you can scale down and scale back up
 - for a RC you can scale down and scale back up
 ```
 ```
 oc scale --replicas=0 <rc_name>
 oc scale --replicas=0 <rc_name>
@@ -183,4 +177,4 @@ Changelog
 ---------
 ---------
 
 
 Tue Oct 10, 2017
 Tue Oct 10, 2017
-- Default imagePullPolicy changed from Always to IfNotPresent 
+- Default imagePullPolicy changed from Always to IfNotPresent

+ 6 - 0
roles/openshift_metrics/defaults/main.yaml

@@ -1,4 +1,10 @@
 ---
 ---
+openshift_metrics_cassandra_image: "{{ l_os_registry_url | regex_replace(l_openshift_logging_search | regex_escape, 'metrics-cassandra') }}"
+openshift_metrics_hawkular_agent_image: "{{ l_os_registry_url | regex_replace(l_openshift_logging_search | regex_escape, 'metrics-hawkular-openshift-agent') }}"
+openshift_metrics_hawkular_metrics_image: "{{ l_os_registry_url | regex_replace(l_openshift_logging_search | regex_escape, 'metrics-hawkular-metrics') }}"
+openshift_metrics_schema_installer_image: "{{ l_os_registry_url | regex_replace(l_openshift_logging_search | regex_escape, 'metrics-schema-installer') }}"
+openshift_metrics_heapster_image: "{{ l_os_registry_url | regex_replace(l_openshift_logging_search | regex_escape, 'metrics-heapster') }}"
+
 openshift_metrics_start_cluster: True
 openshift_metrics_start_cluster: True
 openshift_metrics_install_metrics: False
 openshift_metrics_install_metrics: False
 openshift_metrics_startup_timeout: 500
 openshift_metrics_startup_timeout: 500

+ 1 - 0
roles/openshift_metrics/meta/main.yaml

@@ -18,3 +18,4 @@ dependencies:
 - role: lib_openshift
 - role: lib_openshift
 - role: lib_utils
 - role: lib_utils
 - role: openshift_facts
 - role: openshift_facts
+- role: openshift_logging_defaults

+ 0 - 11
roles/openshift_metrics/tasks/main.yaml

@@ -9,17 +9,6 @@
       - "'not installed' not in passlib_result.stdout"
       - "'not installed' not in passlib_result.stdout"
     msg: "python-passlib rpm must be installed on control host"
     msg: "python-passlib rpm must be installed on control host"
 
 
-- name: Set default image variables based on openshift_deployment_type
-  include_vars: "{{ item }}"
-  with_first_found:
-    - "{{ openshift_deployment_type }}.yml"
-    - "default_images.yml"
-
-- name: Set metrics image facts
-  set_fact:
-    openshift_metrics_image_prefix: "{{ openshift_metrics_image_prefix | default(__openshift_metrics_image_prefix) }}"
-    openshift_metrics_image_version: "{{ openshift_metrics_image_version | default(__openshift_metrics_image_version) }}"
-
 - name: Create temp directory for doing work in on target
 - name: Create temp directory for doing work in on target
   command: mktemp -td openshift-metrics-ansible-XXXXXX
   command: mktemp -td openshift-metrics-ansible-XXXXXX
   register: mktemp
   register: mktemp

+ 1 - 1
roles/openshift_metrics/templates/hawkular_cassandra_rc.j2

@@ -29,7 +29,7 @@ spec:
 {% endfor %}
 {% endfor %}
 {% endif %}
 {% endif %}
       containers:
       containers:
-      - image: "{{ openshift_metrics_image_prefix }}metrics-cassandra:{{ openshift_metrics_image_version }}"
+      - image: "{{ openshift_metrics_cassandra_image }}"
         imagePullPolicy: IfNotPresent
         imagePullPolicy: IfNotPresent
         name: hawkular-cassandra-{{ node }}
         name: hawkular-cassandra-{{ node }}
         ports:
         ports:

+ 1 - 1
roles/openshift_metrics/templates/hawkular_metrics_rc.j2

@@ -24,7 +24,7 @@ spec:
 {% endfor %}
 {% endfor %}
 {% endif %}
 {% endif %}
       containers:
       containers:
-      - image: {{openshift_metrics_image_prefix}}metrics-hawkular-metrics:{{openshift_metrics_image_version}}
+      - image: {{ openshift_metrics_hawkular_metrics_image }}
         imagePullPolicy: IfNotPresent
         imagePullPolicy: IfNotPresent
         name: hawkular-metrics
         name: hawkular-metrics
         ports:
         ports:

+ 1 - 1
roles/openshift_metrics/templates/hawkular_metrics_schema_job.j2

@@ -15,7 +15,7 @@ spec:
           #name: hawkular-metrics
           #name: hawkular-metrics
       containers:
       containers:
       - name: hawkular-metrics-schema
       - name: hawkular-metrics-schema
-        image: {{openshift_metrics_image_prefix}}metrics-schema-installer:{{openshift_metrics_image_version}}
+        image: {{ openshift_metrics_schema_installer_image }}
         imagePullPolicy: IfNotPresent
         imagePullPolicy: IfNotPresent
         env:
         env:
           - name: TRUSTSTORE_AUTHORITIES
           - name: TRUSTSTORE_AUTHORITIES

+ 1 - 1
roles/openshift_metrics/templates/hawkular_openshift_agent_ds.j2

@@ -24,7 +24,7 @@ spec:
 {% endfor %}
 {% endfor %}
 {% endif %}
 {% endif %}
       containers:
       containers:
-      - image: {{openshift_metrics_image_prefix}}metrics-hawkular-openshift-agent:{{openshift_metrics_image_version}}
+      - image: {{ openshift_metrics_hawkular_agent_image }}
         imagePullPolicy: IfNotPresent
         imagePullPolicy: IfNotPresent
         name: hawkular-openshift-agent
         name: hawkular-openshift-agent
 {% if ((openshift_metrics_hawkular_agent_limits_cpu is defined and openshift_metrics_hawkular_agent_limits_cpu is not none)
 {% if ((openshift_metrics_hawkular_agent_limits_cpu is defined and openshift_metrics_hawkular_agent_limits_cpu is not none)

+ 1 - 1
roles/openshift_metrics/templates/heapster.j2

@@ -26,7 +26,7 @@ spec:
 {% endif %}
 {% endif %}
       containers:
       containers:
       - name: heapster
       - name: heapster
-        image: {{openshift_metrics_image_prefix}}metrics-heapster:{{openshift_metrics_image_version}}
+        image: {{ openshift_metrics_heapster_image }}
         imagePullPolicy: IfNotPresent
         imagePullPolicy: IfNotPresent
         ports:
         ports:
         - containerPort: 8082
         - containerPort: 8082

+ 0 - 3
roles/openshift_metrics/vars/default_images.yml

@@ -1,3 +0,0 @@
----
-__openshift_metrics_image_prefix: "docker.io/openshift/origin-"
-__openshift_metrics_image_version: "{{ openshift_image_tag }}"

+ 0 - 3
roles/openshift_metrics/vars/openshift-enterprise.yml

@@ -1,3 +0,0 @@
----
-__openshift_metrics_image_prefix: "registry.access.redhat.com/openshift3/"
-__openshift_metrics_image_version: "{{ openshift_image_tag }}"

+ 0 - 4
roles/openshift_prometheus/README.md

@@ -21,10 +21,6 @@ For default values, see [`defaults/main.yaml`](defaults/main.yaml).
 
 
 - `openshift_prometheus_node_selector`: Selector for the nodes prometheus will be deployed on.
 - `openshift_prometheus_node_selector`: Selector for the nodes prometheus will be deployed on.
 
 
-- `openshift_prometheus_<COMPONENT>_image_prefix`: specify image prefix for the component
-
-- `openshift_prometheus_<COMPONENT>_image_version`: specify image version for the component
-
 - `openshift_prometheus_args`: Modify or add arguments for prometheus application
 - `openshift_prometheus_args`: Modify or add arguments for prometheus application
 
 
 - `openshift_prometheus_hostname`: specify the hostname for the route to prometheus `prometheus-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}}`
 - `openshift_prometheus_hostname`: specify the hostname for the route to prometheus `prometheus-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}}`

+ 35 - 0
roles/openshift_prometheus/defaults/main.yaml

@@ -5,11 +5,46 @@ openshift_prometheus_node_exporter_install: true
 
 
 openshift_prometheus_namespace: openshift-metrics
 openshift_prometheus_namespace: openshift-metrics
 
 
+# Need to standardise these tags
+l_openshift_prometheus_version_dict:
+  origin:
+    prometheus: 'v2.2.1'
+    alert_manager: 'v0.14.0'
+    alert_buffer: 'v0.0.2'
+    node_exporter: 'v0.15.2'
+  openshift-enterprise:
+    prometheus: "{{ openshift_image_tag }}"
+    alert_manager: "{{ openshift_image_tag }}"
+    alert_buffer: "{{ openshift_image_tag }}"
+    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) }}"
+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) }}"
+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) }}"
+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) }}"
+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 }}"
+
 # defaults hosts for routes
 # defaults hosts for routes
 openshift_prometheus_hostname: prometheus-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}}
 openshift_prometheus_hostname: prometheus-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}}
 openshift_prometheus_alerts_hostname: alerts-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}}
 openshift_prometheus_alerts_hostname: alerts-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}}
 openshift_prometheus_alertmanager_hostname: alertmanager-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}}
 openshift_prometheus_alertmanager_hostname: alertmanager-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}}
 
 
+l_openshift_prometheus_image_version: "{{ openshift_prometheus_image_version | default('v2.2.1') }}"
+l_openshift_prometheus_alertmanager_image_version: "{{ openshift_prometheus_alertmanager_image_version | default('v0.14.0') }}"
+l_openshift_prometheus_alertbuffer_image_version: "{{ openshift_prometheus_alertbuffer_image_version | default('v0.0.2') }}"
+l_openshift_prometheus_node_exporter_image_version: "{{ openshift_prometheus_node_exporter_image_version | default('v0.15.2') }}"
 
 
 openshift_prometheus_node_selector: {"node-role.kubernetes.io/infra":"true"}
 openshift_prometheus_node_selector: {"node-role.kubernetes.io/infra":"true"}
 
 

+ 1 - 0
roles/openshift_prometheus/meta/main.yaml

@@ -18,3 +18,4 @@ dependencies:
 - role: lib_openshift
 - role: lib_openshift
 - role: openshift_facts
 - role: openshift_facts
 - role: lib_utils
 - role: lib_utils
+- role: openshift_logging_defaults

+ 1 - 1
roles/openshift_prometheus/tasks/install_node_exporter.yaml

@@ -39,7 +39,7 @@
 - name: Apply the node exporter template file
 - name: Apply the node exporter template file
   shell: >
   shell: >
     {{ openshift_client_binary }} process -f "{{ mktemp.stdout }}/{{ __node_exporter_template_file }}"
     {{ openshift_client_binary }} process -f "{{ mktemp.stdout }}/{{ __node_exporter_template_file }}"
-    --param IMAGE="{{ l_openshift_prometheus_node_exporter_image_prefix }}prometheus-node-exporter:{{ l_openshift_prometheus_node_exporter_image_version }}"
+    --param IMAGE="{{ openshift_prometheus_node_exporter_image }}"
     --param MEMORY_REQUESTS="{{ openshift_prometheus_node_exporter_memory_requests }}"
     --param MEMORY_REQUESTS="{{ openshift_prometheus_node_exporter_memory_requests }}"
     --param CPU_REQUESTS="{{ openshift_prometheus_node_exporter_cpu_requests }}"
     --param CPU_REQUESTS="{{ openshift_prometheus_node_exporter_cpu_requests }}"
     --param MEMORY_LIMITS="{{ openshift_prometheus_node_exporter_memory_limit }}"
     --param MEMORY_LIMITS="{{ openshift_prometheus_node_exporter_memory_limit }}"

+ 0 - 5
roles/openshift_prometheus/tasks/main.yaml

@@ -1,9 +1,4 @@
 ---
 ---
-- name: Set default image variables based on openshift_deployment_type
-  include_vars: "{{ item }}"
-  with_first_found:
-    - "{{ openshift_deployment_type }}.yml"
-    - "default_images.yml"
 
 
 - name: Create temp directory for doing work in on target
 - name: Create temp directory for doing work in on target
   command: mktemp -td openshift-prometheus-ansible-XXXXXX
   command: mktemp -td openshift-prometheus-ansible-XXXXXX

+ 6 - 6
roles/openshift_prometheus/templates/prometheus.j2

@@ -29,7 +29,7 @@ spec:
       containers:
       containers:
       # Deploy Prometheus behind an oauth proxy
       # Deploy Prometheus behind an oauth proxy
       - name: prom-proxy
       - name: prom-proxy
-        image: "{{ l_openshift_prometheus_proxy_image_prefix }}oauth-proxy:{{ l_openshift_prometheus_proxy_image_version }}"
+        image: "{{ openshift_prometheus_proxy_image }}"
         imagePullPolicy: IfNotPresent
         imagePullPolicy: IfNotPresent
         resources:
         resources:
           requests:
           requests:
@@ -80,7 +80,7 @@ spec:
 {% endfor %}
 {% endfor %}
         - --config.file=/etc/prometheus/prometheus.yml
         - --config.file=/etc/prometheus/prometheus.yml
         - --web.listen-address=localhost:9090
         - --web.listen-address=localhost:9090
-        image: "{{ l_openshift_prometheus_image_prefix }}prometheus:{{ l_openshift_prometheus_image_version }}"
+        image: "{{ openshift_prometheus_image }}"
         imagePullPolicy: IfNotPresent
         imagePullPolicy: IfNotPresent
         livenessProbe:
         livenessProbe:
           exec:
           exec:
@@ -120,7 +120,7 @@ spec:
 
 
       # Deploy alert-buffer behind oauth alerts-proxy
       # Deploy alert-buffer behind oauth alerts-proxy
       - name: alerts-proxy
       - name: alerts-proxy
-        image: "{{ l_openshift_prometheus_proxy_image_prefix }}oauth-proxy:{{ l_openshift_prometheus_proxy_image_version }}"
+        image: "{{ openshift_prometheus_proxy_image }}"
         imagePullPolicy: IfNotPresent
         imagePullPolicy: IfNotPresent
         resources:
         resources:
           requests:
           requests:
@@ -165,7 +165,7 @@ spec:
       - name: alert-buffer
       - name: alert-buffer
         args:
         args:
         - --storage-path=/alert-buffer/messages.db
         - --storage-path=/alert-buffer/messages.db
-        image: "{{ l_openshift_prometheus_alertbuffer_image_prefix }}prometheus-alert-buffer:{{ l_openshift_prometheus_alertbuffer_image_version }}"
+        image: "{{ openshift_prometheus_alertbuffer_image }}"
         imagePullPolicy: IfNotPresent
         imagePullPolicy: IfNotPresent
         resources:
         resources:
           requests:
           requests:
@@ -188,7 +188,7 @@ spec:
 
 
       # Deploy alertmanager behind oauth alertmanager-proxy
       # Deploy alertmanager behind oauth alertmanager-proxy
       - name: alertmanager-proxy
       - name: alertmanager-proxy
-        image: "{{ l_openshift_prometheus_proxy_image_prefix }}oauth-proxy:{{ l_openshift_prometheus_proxy_image_version }}"
+        image: "{{ openshift_prometheus_proxy_image }}"
         imagePullPolicy: IfNotPresent
         imagePullPolicy: IfNotPresent
         requests:
         requests:
 {% if openshift_prometheus_oauth_proxy_memory_requests is defined and openshift_prometheus_oauth_proxy_memory_requests is not none %}
 {% if openshift_prometheus_oauth_proxy_memory_requests is defined and openshift_prometheus_oauth_proxy_memory_requests is not none %}
@@ -232,7 +232,7 @@ spec:
       - name: alertmanager
       - name: alertmanager
         args:
         args:
         - --config.file=/etc/alertmanager/alertmanager.yml
         - --config.file=/etc/alertmanager/alertmanager.yml
-        image: "{{ l_openshift_prometheus_alertmanager_image_prefix }}prometheus-alertmanager:{{ l_openshift_prometheus_alertmanager_image_version }}"
+        image: "{{ openshift_prometheus_alertmanager_image }}"
         imagePullPolicy: IfNotPresent
         imagePullPolicy: IfNotPresent
         resources:
         resources:
           requests:
           requests:

+ 0 - 14
roles/openshift_prometheus/vars/default_images.yml

@@ -1,14 +0,0 @@
----
-# image prefix defaults
-l_openshift_prometheus_image_prefix: "{{ openshift_prometheus_image_prefix | default('openshift/') }}"
-l_openshift_prometheus_proxy_image_prefix: "{{ openshift_prometheus_proxy_image_prefix | default(l_openshift_prometheus_image_prefix) }}"
-l_openshift_prometheus_alertmanager_image_prefix: "{{ openshift_prometheus_altermanager_image_prefix | default(l_openshift_prometheus_image_prefix) }}"
-l_openshift_prometheus_alertbuffer_image_prefix: "{{ openshift_prometheus_alertbuffer_image_prefix | default(l_openshift_prometheus_image_prefix) }}"
-l_openshift_prometheus_node_exporter_image_prefix: "{{ openshift_prometheus_node_exporter_image_prefix | default(l_openshift_prometheus_image_prefix) }}"
-
-# image version defaults
-l_openshift_prometheus_image_version: "{{ openshift_prometheus_image_version | default('v2.2.1') }}"
-l_openshift_prometheus_proxy_image_version: "{{ openshift_prometheus_proxy_image_version | default('v1.0.0') }}"
-l_openshift_prometheus_alertmanager_image_version: "{{ openshift_prometheus_alertmanager_image_version | default('v0.14.0') }}"
-l_openshift_prometheus_alertbuffer_image_version: "{{ openshift_prometheus_alertbuffer_image_version | default('v0.0.2') }}"
-l_openshift_prometheus_node_exporter_image_version: "{{ openshift_prometheus_node_exporter_image_version | default('v0.15.2') }}"

+ 0 - 14
roles/openshift_prometheus/vars/openshift-enterprise.yml

@@ -1,14 +0,0 @@
----
-# image prefix defaults
-l_openshift_prometheus_image_prefix: "{{ openshift_prometheus_image_prefix | default('registry.access.redhat.com/openshift3/') }}"
-l_openshift_prometheus_proxy_image_prefix: "{{ openshift_prometheus_proxy_image_prefix | default(l_openshift_prometheus_image_prefix) }}"
-l_openshift_prometheus_alertmanager_image_prefix: "{{ openshift_prometheus_altermanager_image_prefix | default(l_openshift_prometheus_image_prefix) }}"
-l_openshift_prometheus_alertbuffer_image_prefix: "{{ openshift_prometheus_alertbuffer_image_prefix | default(l_openshift_prometheus_image_prefix) }}"
-l_openshift_prometheus_node_exporter_image_prefix: "{{ openshift_prometheus_node_exporter_image_prefix | default(l_openshift_prometheus_image_prefix) }}"
-
-# image version defaults
-l_openshift_prometheus_image_version: "{{ openshift_prometheus_image_version | default(openshift_image_tag) }}"
-l_openshift_prometheus_proxy_image_version: "{{ openshift_prometheus_proxy_image_version | default(openshift_image_tag) }}"
-l_openshift_prometheus_alertmanager_image_version: "{{ openshift_prometheus_alertmanager_image_version | default(openshift_image_tag) }}"
-l_openshift_prometheus_alertbuffer_image_version: "{{ openshift_prometheus_alertbuffer_image_version | default(openshift_image_tag) }}"
-l_openshift_prometheus_node_exporter_image_version: "{{ openshift_prometheus_node_exporter_image_version | default(openshift_image_tag) }}"