Browse Source

Merge pull request #6037 from ewolinetz/logging_default_images

Automatic merge from submit-queue.

Updating logging components image defaulting pattern

Matches openshift_logging pattern and pattern used by other ansible components

Addresses:
https://bugzilla.redhat.com/show_bug.cgi?id=1505681
OpenShift Merge Robot 7 years ago
parent
commit
9df9090539
32 changed files with 204 additions and 129 deletions
  1. 0 11
      roles/openshift_logging/tasks/main.yaml
  2. 0 3
      roles/openshift_logging/vars/default_images.yml
  3. 0 3
      roles/openshift_logging/vars/openshift-enterprise.yml
  4. 0 2
      roles/openshift_logging_curator/defaults/main.yml
  5. 5 5
      roles/openshift_logging_curator/tasks/determine_version.yaml
  6. 21 8
      roles/openshift_logging_curator/tasks/main.yaml
  7. 3 0
      roles/openshift_logging_curator/vars/default_images.yml
  8. 3 0
      roles/openshift_logging_curator/vars/openshift-enterprise.yml
  9. 0 2
      roles/openshift_logging_elasticsearch/defaults/main.yml
  10. 5 7
      roles/openshift_logging_elasticsearch/tasks/determine_version.yaml
  11. 8 4
      roles/openshift_logging_elasticsearch/tasks/main.yaml
  12. 4 2
      roles/openshift_logging_elasticsearch/vars/default_images.yml
  13. 3 1
      roles/openshift_logging_elasticsearch/vars/openshift-enterprise.yml
  14. 0 2
      roles/openshift_logging_eventrouter/defaults/main.yaml
  15. 13 0
      roles/openshift_logging_eventrouter/tasks/main.yaml
  16. 3 0
      roles/openshift_logging_eventrouter/vars/default_images.yml
  17. 3 0
      roles/openshift_logging_eventrouter/vars/openshift-enterprise.yml
  18. 0 2
      roles/openshift_logging_fluentd/defaults/main.yml
  19. 5 5
      roles/openshift_logging_fluentd/tasks/determine_version.yaml
  20. 21 8
      roles/openshift_logging_fluentd/tasks/main.yaml
  21. 3 0
      roles/openshift_logging_fluentd/vars/default_images.yml
  22. 3 0
      roles/openshift_logging_fluentd/vars/openshift-enterprise.yml
  23. 0 4
      roles/openshift_logging_kibana/defaults/main.yml
  24. 5 5
      roles/openshift_logging_kibana/tasks/determine_version.yaml
  25. 44 30
      roles/openshift_logging_kibana/tasks/main.yaml
  26. 5 0
      roles/openshift_logging_kibana/vars/default_images.yml
  27. 5 0
      roles/openshift_logging_kibana/vars/openshift-enterprise.yml
  28. 0 2
      roles/openshift_logging_mux/defaults/main.yml
  29. 5 5
      roles/openshift_logging_mux/tasks/determine_version.yaml
  30. 31 18
      roles/openshift_logging_mux/tasks/main.yaml
  31. 3 0
      roles/openshift_logging_mux/vars/default_images.yml
  32. 3 0
      roles/openshift_logging_mux/vars/openshift-enterprise.yml

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

@@ -3,17 +3,6 @@
     msg: Only one Fluentd nodeselector key pair should be provided
   when: openshift_logging_fluentd_nodeselector.keys() | count > 1
 
-- name: Set default image variables based on deployment_type
-  include_vars: "{{ item }}"
-  with_first_found:
-    - "{{ openshift_deployment_type | default(deployment_type) }}.yml"
-    - "default_images.yml"
-
-- name: Set logging image facts
-  set_fact:
-    openshift_logging_image_prefix: "{{ openshift_logging_image_prefix | default(__openshift_logging_image_prefix) }}"
-    openshift_logging_image_version: "{{ openshift_logging_image_version | default(__openshift_logging_image_version) }}"
-
 - name: Create temp directory for doing work in
   command: mktemp -d /tmp/openshift-logging-ansible-XXXXXX
   register: mktemp

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

@@ -1,3 +0,0 @@
----
-__openshift_logging_image_prefix: "{{ openshift_hosted_logging_deployer_prefix | default('docker.io/openshift/origin-') }}"
-__openshift_logging_image_version: "{{ openshift_hosted_logging_deployer_version | default('latest') }}"

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

@@ -1,3 +0,0 @@
----
-__openshift_logging_image_prefix: "{{ openshift_hosted_logging_deployer_prefix | default('registry.access.redhat.com/openshift3/') }}"
-__openshift_logging_image_version: "{{ openshift_hosted_logging_deployer_version | default ('v3.7') }}"

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

@@ -1,7 +1,5 @@
 ---
 ### General logging settings
-openshift_logging_curator_image_prefix: "{{ openshift_logging_image_prefix | default(__openshift_logging_image_prefix) }}"
-openshift_logging_curator_image_version: "{{ openshift_logging_image_version | default('latest') }}"
 openshift_logging_curator_image_pull_secret: "{{ openshift_hosted_logging_image_pull_secret | default('') }}"
 openshift_logging_curator_master_url: "https://kubernetes.default.svc.cluster.local"
 

+ 5 - 5
roles/openshift_logging_curator/tasks/determine_version.yaml

@@ -1,16 +1,16 @@
 ---
 # debating making this a module instead?
 - fail:
-    msg: Missing version to install provided by 'openshift_logging_image_version'
-  when: not openshift_logging_image_version or openshift_logging_image_version == ''
+    msg: Missing version to install provided by 'openshift_logging_curator_image_version'
+  when: not openshift_logging_curator_image_version or openshift_logging_curator_image_version == ''
 
 - set_fact:
     curator_version: "{{ __latest_curator_version }}"
-  when: openshift_logging_image_version == 'latest'
+  when: openshift_logging_curator_image_version == 'latest'
 
 # should we just assume that we will have the correct major version?
-- set_fact: curator_version="{{ openshift_logging_image_version | regex_replace('^v?(?P<major>\d)\.(?P<minor>\d).*$', '3_\\g<minor>') }}"
-  when: openshift_logging_image_version != 'latest'
+- set_fact: curator_version="{{ openshift_logging_curator_image_version | regex_replace('^v?(?P<major>\d)\.(?P<minor>\d).*$', '3_\\g<minor>') }}"
+  when: openshift_logging_curator_image_version != 'latest'
 
 - fail:
     msg: Invalid version specified for Curator

+ 21 - 8
roles/openshift_logging_curator/tasks/main.yaml

@@ -1,4 +1,17 @@
 ---
+- name: Set default image variables based on deployment_type
+  include_vars: "{{ var_file_name }}"
+  with_first_found:
+    - "{{ openshift_deployment_type | default(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) }}"
+
 - include: determine_version.yaml
 
 # allow passing in a tempdir
@@ -35,7 +48,7 @@
     name: "aggregated-logging-curator"
     namespace: "{{ openshift_logging_namespace }}"
   when:
-  - openshift_logging_image_pull_secret == ''
+    - openshift_logging_image_pull_secret == ''
 
 # configmap
 - copy:
@@ -65,12 +78,12 @@
     name: "logging-curator"
     namespace: "{{ openshift_logging_namespace }}"
     files:
-    - name: ca
-      path: "{{ generated_certs_dir }}/ca.crt"
-    - name: key
-      path: "{{ generated_certs_dir }}/system.logging.curator.key"
-    - name: cert
-      path: "{{ generated_certs_dir }}/system.logging.curator.crt"
+      - name: ca
+        path: "{{ generated_certs_dir }}/ca.crt"
+      - name: key
+        path: "{{ generated_certs_dir }}/system.logging.curator.key"
+      - name: cert
+        path: "{{ generated_certs_dir }}/system.logging.curator.crt"
 
 - set_fact:
     curator_name: "{{ 'logging-curator' ~ ( (openshift_logging_curator_ops_deployment | default(false) | bool) | ternary('-ops', '') ) }}"
@@ -104,7 +117,7 @@
     namespace: "{{ openshift_logging_namespace }}"
     kind: dc
     files:
-    - "{{ tempdir }}/templates/curator-dc.yaml"
+      - "{{ tempdir }}/templates/curator-dc.yaml"
     delete_after: true
 
 - name: Delete temp directory

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

@@ -0,0 +1,3 @@
+---
+__openshift_logging_curator_image_prefix: "{{ openshift_logging_image_prefix | default('docker.io/openshift/origin-') }}"
+__openshift_logging_curator_image_version: "{{ openshift_logging_image_version | default('latest') }}"

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

@@ -0,0 +1,3 @@
+---
+__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 ('v3.7') }}"

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

@@ -1,7 +1,5 @@
 ---
 ### Common settings
-openshift_logging_elasticsearch_image_prefix: "{{ openshift_logging_image_prefix | default(__openshift_logging_image_prefix) }}"
-openshift_logging_elasticsearch_image_version: "{{ openshift_logging_image_version | default('latest') }}"
 openshift_logging_elasticsearch_image_pull_secret: "{{ openshift_hosted_logging_image_pull_secret | default('') }}"
 openshift_logging_elasticsearch_namespace: logging
 

+ 5 - 7
roles/openshift_logging_elasticsearch/tasks/determine_version.yaml

@@ -1,18 +1,16 @@
 ---
 # debating making this a module instead?
 - fail:
-    msg: Missing version to install provided by 'openshift_logging_image_version'
-  when: not openshift_logging_image_version or openshift_logging_image_version == ''
+    msg: Missing version to install provided by 'openshift_logging_elasticsearch_image_version'
+  when: not openshift_logging_elasticsearch_image_version or openshift_logging_elasticsearch_image_version == ''
 
 - set_fact:
     es_version: "{{ __latest_es_version }}"
-  when: openshift_logging_image_version == 'latest'
-
-- debug: var=openshift_logging_image_version
+  when: openshift_logging_elasticsearch_image_version == 'latest'
 
 # should we just assume that we will have the correct major version?
-- set_fact: es_version="{{ openshift_logging_image_version | regex_replace('^v?(?P<major>\d)\.(?P<minor>\d).*$', '3_\\g<minor>') }}"
-  when: openshift_logging_image_version != 'latest'
+- set_fact: es_version="{{ openshift_logging_elasticsearch_image_version | regex_replace('^v?(?P<major>\d)\.(?P<minor>\d).*$', '3_\\g<minor>') }}"
+  when: openshift_logging_elasticsearch_image_version != 'latest'
 
 - fail:
     msg: Invalid version specified for Elasticsearch

+ 8 - 4
roles/openshift_logging_elasticsearch/tasks/main.yaml

@@ -15,18 +15,22 @@
     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', '') ) }}"
 
-- include: determine_version.yaml
-
 - name: Set default image variables based on deployment_type
-  include_vars: "{{ item }}"
+  include_vars: "{{ var_file_name }}"
   with_first_found:
     - "{{ openshift_deployment_type | default(deployment_type) }}.yml"
     - "default_images.yml"
+  loop_control:
+    loop_var: var_file_name
 
-- name: Set elasticsearch_prefix image facts
+- 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: determine_version.yaml
 
 # allow passing in a tempdir
 - name: Create temp directory for doing work in

+ 4 - 2
roles/openshift_logging_elasticsearch/vars/default_images.yml

@@ -1,3 +1,5 @@
 ---
-__openshift_logging_elasticsearch_proxy_image_prefix: "docker.io/openshift/"
-__openshift_logging_elasticsearch_proxy_image_version: "v1.0.0"
+__openshift_logging_elasticsearch_image_prefix: "{{ openshift_logging_image_prefix | default('docker.io/openshift/origin-') }}"
+__openshift_logging_elasticsearch_image_version: "{{ openshift_logging_image_version | default('latest') }}"
+__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') }}"

+ 3 - 1
roles/openshift_logging_elasticsearch/vars/openshift-enterprise.yml

@@ -1,3 +1,5 @@
 ---
+__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 ('v3.7') }}"
 __openshift_logging_elasticsearch_proxy_image_prefix: "{{ openshift_logging_image_prefix | default('registry.access.redhat.com/openshift3/') }}"
-__openshift_logging_elasticsearch_proxy_image_version: "v3.7"
+__openshift_logging_elasticsearch_proxy_image_version: "{{ openshift_logging_image_version | default ('v3.7') }}"

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

@@ -1,6 +1,4 @@
 ---
-openshift_logging_eventrouter_image_prefix: "{{ openshift_logging_image_prefix | default(__openshift_logging_image_prefix) }}"
-openshift_logging_eventrouter_image_version: "{{ openshift_logging_image_version | default('latest') }}"
 openshift_logging_eventrouter_replicas: 1
 openshift_logging_eventrouter_sink: stdout
 openshift_logging_eventrouter_nodeselector: ""

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

@@ -1,4 +1,17 @@
 ---
+- name: Set default image variables based on deployment_type
+  include_vars: "{{ var_file_name }}"
+  with_first_found:
+    - "{{ openshift_deployment_type | default(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: "{{ role_path }}/tasks/install_eventrouter.yaml"
   when: openshift_logging_install_eventrouter | default(false) | bool
 

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

@@ -0,0 +1,3 @@
+---
+__openshift_logging_eventrouter_image_prefix: "{{ openshift_logging_image_prefix | default('docker.io/openshift/origin-') }}"
+__openshift_logging_eventrouter_image_version: "{{ openshift_logging_image_version | default('latest') }}"

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

@@ -0,0 +1,3 @@
+---
+__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 ('v3.7') }}"

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

@@ -1,7 +1,5 @@
 ---
 ### General logging settings
-openshift_logging_fluentd_image_prefix: "{{ openshift_logging_image_prefix | default(__openshift_logging_image_prefix) }}"
-openshift_logging_fluentd_image_version: "{{ openshift_logging_image_version | default('latest') }}"
 openshift_logging_fluentd_image_pull_secret: "{{ openshift_hosted_logging_image_pull_secret | default('') }}"
 openshift_logging_fluentd_master_url: "https://kubernetes.default.svc.{{ openshift.common.dns_domain }}"
 openshift_logging_fluentd_namespace: logging

+ 5 - 5
roles/openshift_logging_fluentd/tasks/determine_version.yaml

@@ -1,16 +1,16 @@
 ---
 # debating making this a module instead?
 - fail:
-    msg: Missing version to install provided by 'openshift_logging_image_version'
-  when: not openshift_logging_image_version or openshift_logging_image_version == ''
+    msg: Missing version to install provided by 'openshift_logging_fluentd_image_version'
+  when: not openshift_logging_fluentd_image_version or openshift_logging_fluentd_image_version == ''
 
 - set_fact:
     fluentd_version: "{{ __latest_fluentd_version }}"
-  when: openshift_logging_image_version == 'latest'
+  when: openshift_logging_fluentd_image_version == 'latest'
 
 # should we just assume that we will have the correct major version?
-- set_fact: fluentd_version="{{ openshift_logging_image_version | regex_replace('^v?(?P<major>\d)\.(?P<minor>\d).*$', '3_\\g<minor>') }}"
-  when: openshift_logging_image_version != 'latest'
+- set_fact: fluentd_version="{{ openshift_logging_fluentd_image_version | regex_replace('^v?(?P<major>\d)\.(?P<minor>\d).*$', '3_\\g<minor>') }}"
+  when: openshift_logging_fluentd_image_version != 'latest'
 
 - fail:
     msg: Invalid version specified for Fluentd

+ 21 - 8
roles/openshift_logging_fluentd/tasks/main.yaml

@@ -34,6 +34,19 @@
     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'
 
+- name: Set default image variables based on deployment_type
+  include_vars: "{{ var_file_name }}"
+  with_first_found:
+    - "{{ openshift_deployment_type | default(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) }}"
+
 - include: determine_version.yaml
 
 # allow passing in a tempdir
@@ -69,7 +82,7 @@
     name: "aggregated-logging-fluentd"
     namespace: "{{ openshift_logging_fluentd_namespace }}"
   when:
-  - openshift_logging_image_pull_secret == ''
+    - openshift_logging_image_pull_secret == ''
 
 # set service account scc
 - name: Set privileged permissions for Fluentd
@@ -146,12 +159,12 @@
     name: logging-fluentd
     namespace: "{{ openshift_logging_fluentd_namespace }}"
     files:
-    - name: ca
-      path: "{{ generated_certs_dir }}/ca.crt"
-    - name: key
-      path: "{{ generated_certs_dir }}/system.logging.fluentd.key"
-    - name: cert
-      path: "{{ generated_certs_dir }}/system.logging.fluentd.crt"
+      - name: ca
+        path: "{{ generated_certs_dir }}/ca.crt"
+      - name: key
+        path: "{{ generated_certs_dir }}/system.logging.fluentd.key"
+      - name: cert
+        path: "{{ generated_certs_dir }}/system.logging.fluentd.crt"
 
 # create Fluentd daemonset
 # this should change based on the type of fluentd deployment to be done...
@@ -187,7 +200,7 @@
     namespace: "{{ openshift_logging_fluentd_namespace }}"
     kind: daemonset
     files:
-    - "{{ tempdir }}/templates/logging-fluentd.yaml"
+      - "{{ tempdir }}/templates/logging-fluentd.yaml"
     delete_after: true
 
 # Scale up Fluentd

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

@@ -0,0 +1,3 @@
+---
+__openshift_logging_fluentd_image_prefix: "{{ openshift_logging_image_prefix | default('docker.io/openshift/origin-') }}"
+__openshift_logging_fluentd_image_version: "{{ openshift_logging_image_version | default('latest') }}"

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

@@ -0,0 +1,3 @@
+---
+__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 ('v3.7') }}"

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

@@ -2,8 +2,6 @@
 ### Common settings
 openshift_logging_kibana_master_url: "https://kubernetes.default.svc.cluster.local"
 openshift_logging_kibana_master_public_url: "https://kubernetes.default.svc.cluster.local"
-openshift_logging_kibana_image_prefix: "{{ openshift_logging_image_prefix | default(__openshift_logging_image_prefix) }}"
-openshift_logging_kibana_image_version: "{{ openshift_logging_image_version | default('latest') }}"
 openshift_logging_kibana_image_pull_secret: "{{ openshift_hosted_logging_image_pull_secret | default('') }}"
 openshift_logging_kibana_namespace: logging
 
@@ -25,8 +23,6 @@ openshift_logging_kibana_edge_term_policy: Redirect
 openshift_logging_kibana_ops_deployment: false
 
 # Proxy settings
-openshift_logging_kibana_proxy_image_prefix: "{{ openshift_logging_image_prefix | default(__openshift_logging_image_prefix) }}"
-openshift_logging_kibana_proxy_image_version: "{{ openshift_logging_image_version | default('latest') }}"
 openshift_logging_kibana_proxy_debug: false
 openshift_logging_kibana_proxy_cpu_limit: null
 openshift_logging_kibana_proxy_cpu_request: 100m

+ 5 - 5
roles/openshift_logging_kibana/tasks/determine_version.yaml

@@ -1,16 +1,16 @@
 ---
 # debating making this a module instead?
 - fail:
-    msg: Missing version to install provided by 'openshift_logging_image_version'
-  when: not openshift_logging_image_version or openshift_logging_image_version == ''
+    msg: Missing version to install provided by 'openshift_logging_kibana_image_version'
+  when: not openshift_logging_kibana_image_version or openshift_logging_kibana_image_version == ''
 
 - set_fact:
     kibana_version: "{{ __latest_kibana_version }}"
-  when: openshift_logging_image_version == 'latest'
+  when: openshift_logging_kibana_image_version == 'latest'
 
 # should we just assume that we will have the correct major version?
-- set_fact: kibana_version="{{ openshift_logging_image_version | regex_replace('^v?(?P<major>\d)\.(?P<minor>\d).*$', '3_\\g<minor>') }}"
-  when: openshift_logging_image_version != 'latest'
+- set_fact: kibana_version="{{ openshift_logging_kibana_image_version | regex_replace('^v?(?P<major>\d)\.(?P<minor>\d).*$', '3_\\g<minor>') }}"
+  when: openshift_logging_kibana_image_version != 'latest'
 
 - fail:
     msg: Invalid version specified for Kibana

+ 44 - 30
roles/openshift_logging_kibana/tasks/main.yaml

@@ -1,5 +1,19 @@
 ---
 # fail is we don't have an endpoint for ES to connect to?
+- name: Set default image variables based on deployment_type
+  include_vars: "{{ var_file_name }}"
+  with_first_found:
+    - "{{ openshift_deployment_type | default(deployment_type) }}.yml"
+    - "default_images.yml"
+  loop_control:
+    loop_var: var_file_name
+
+- 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) }}"
 
 - include: determine_version.yaml
 
@@ -37,7 +51,7 @@
     name: "aggregated-logging-kibana"
     namespace: "{{ openshift_logging_namespace }}"
   when:
-  - openshift_logging_image_pull_secret == ''
+    - openshift_logging_image_pull_secret == ''
 
 - set_fact:
     kibana_name: "{{ 'logging-kibana' ~ ( (openshift_logging_kibana_ops_deployment | default(false) | bool) | ternary('-ops', '')) }}"
@@ -58,7 +72,7 @@
     content: "{{ 200 | oo_random_word }}"
     dest: "{{ generated_certs_dir }}/session_secret"
   when:
-  - not session_secret_file.stat.exists
+    - not session_secret_file.stat.exists
 
 # gen oauth_secret if necessary
 - name: Generate oauth secret
@@ -66,19 +80,19 @@
     content: "{{ 64 | oo_random_word }}"
     dest: "{{ generated_certs_dir }}/oauth_secret"
   when:
-  - not oauth_secret_file.stat.exists
+    - not oauth_secret_file.stat.exists
 
 - name: Retrieving the cert to use when generating secrets for the logging components
   slurp:
     src: "{{ generated_certs_dir }}/{{ item.file }}"
   register: key_pairs
   with_items:
-  - { name: "ca_file", file: "ca.crt" }
-  - { name: "kibana_internal_key", file: "kibana-internal.key"}
-  - { name: "kibana_internal_cert", file: "kibana-internal.crt"}
-  - { name: "server_tls", file: "server-tls.json"}
-  - { name: "session_secret", file: "session_secret" }
-  - { name: "oauth_secret", file: "oauth_secret" }
+    - { name: "ca_file", file: "ca.crt" }
+    - { name: "kibana_internal_key", file: "kibana-internal.key"}
+    - { name: "kibana_internal_cert", file: "kibana-internal.crt"}
+    - { name: "server_tls", file: "server-tls.json"}
+    - { name: "session_secret", file: "session_secret" }
+    - { name: "oauth_secret", file: "oauth_secret" }
 
 # services
 - name: Set {{ kibana_name }} service
@@ -92,8 +106,8 @@
     labels:
       logging-infra: 'support'
     ports:
-    - port: 443
-      targetPort: "oaproxy"
+      - port: 443
+        targetPort: "oaproxy"
 
 # create routes
 # TODO: set up these certs differently?
@@ -144,7 +158,7 @@
     namespace: "{{ openshift_logging_namespace }}"
     kind: route
     files:
-    - "{{ tempdir }}/templates/kibana-route.yaml"
+      - "{{ tempdir }}/templates/kibana-route.yaml"
 
 # preserve list of current hostnames
 - name: Get current oauthclient hostnames
@@ -173,7 +187,7 @@
     namespace: "{{ openshift_logging_namespace }}"
     kind: oauthclient
     files:
-    - "{{ tempdir }}/templates/oauth-client.yml"
+      - "{{ tempdir }}/templates/oauth-client.yml"
     delete_after: true
 
 # create Kibana secret
@@ -183,12 +197,12 @@
     name: "logging-kibana"
     namespace: "{{ openshift_logging_namespace }}"
     files:
-    - name: ca
-      path: "{{ generated_certs_dir }}/ca.crt"
-    - name: key
-      path: "{{ generated_certs_dir }}/system.logging.kibana.key"
-    - name: cert
-      path: "{{ generated_certs_dir }}/system.logging.kibana.crt"
+      - name: ca
+        path: "{{ generated_certs_dir }}/ca.crt"
+      - name: key
+        path: "{{ generated_certs_dir }}/system.logging.kibana.key"
+      - name: cert
+        path: "{{ generated_certs_dir }}/system.logging.kibana.crt"
 
 # create Kibana-proxy secret
 - name: Set Kibana Proxy secret
@@ -205,16 +219,16 @@
     #- name: server-tls.json
     #  path: "{{ generated_certs_dir }}/server-tls.json"
     contents:
-    - path: oauth-secret
-      data: "{{ key_pairs | entry_from_named_pair('oauth_secret') | b64decode }}"
-    - path: session-secret
-      data: "{{ key_pairs | entry_from_named_pair('session_secret') | b64decode }}"
-    - path: server-key
-      data: "{{ key_pairs | entry_from_named_pair('kibana_internal_key') | b64decode }}"
-    - path: server-cert
-      data: "{{ key_pairs | entry_from_named_pair('kibana_internal_cert') | b64decode }}"
-    - path: server-tls.json
-      data: "{{ key_pairs | entry_from_named_pair('server_tls') | b64decode }}"
+      - path: oauth-secret
+        data: "{{ key_pairs | entry_from_named_pair('oauth_secret') | b64decode }}"
+      - path: session-secret
+        data: "{{ key_pairs | entry_from_named_pair('session_secret') | b64decode }}"
+      - path: server-key
+        data: "{{ key_pairs | entry_from_named_pair('kibana_internal_key') | b64decode }}"
+      - path: server-cert
+        data: "{{ key_pairs | entry_from_named_pair('kibana_internal_cert') | b64decode }}"
+      - path: server-tls.json
+        data: "{{ key_pairs | entry_from_named_pair('server_tls') | b64decode }}"
 
 # create Kibana DC
 - name: Generate Kibana DC template
@@ -245,7 +259,7 @@
     namespace: "{{ openshift_logging_namespace }}"
     kind: dc
     files:
-    - "{{ tempdir }}/templates/kibana-dc.yaml"
+      - "{{ tempdir }}/templates/kibana-dc.yaml"
     delete_after: true
 
 # update master configs?

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

@@ -0,0 +1,5 @@
+---
+__openshift_logging_kibana_image_prefix: "{{ openshift_logging_image_prefix | default('docker.io/openshift/origin-') }}"
+__openshift_logging_kibana_image_version: "{{ openshift_logging_image_version | default('latest') }}"
+__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('latest') }}"

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

@@ -0,0 +1,5 @@
+---
+__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 ('v3.7') }}"
+__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 ('v3.7') }}"

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

@@ -1,7 +1,5 @@
 ---
 ### General logging settings
-openshift_logging_mux_image_prefix: "{{ openshift_logging_image_prefix | default(__openshift_logging_image_prefix) }}"
-openshift_logging_mux_image_version: "{{ openshift_logging_image_version | default('latest') }}"
 openshift_logging_mux_image_pull_secret: "{{ openshift_hosted_logging_image_pull_secret | default('') }}"
 openshift_logging_mux_master_url: "https://kubernetes.default.svc.{{ openshift.common.dns_domain }}"
 openshift_logging_mux_master_public_url: "{{ openshift_hosted_logging_master_public_url | default('https://' + openshift.common.public_hostname + ':' ~ (openshift_master_api_port | default('8443', true))) }}"

+ 5 - 5
roles/openshift_logging_mux/tasks/determine_version.yaml

@@ -1,16 +1,16 @@
 ---
 # debating making this a module instead?
 - fail:
-    msg: Missing version to install provided by 'openshift_logging_image_version'
-  when: not openshift_logging_image_version or openshift_logging_image_version == ''
+    msg: Missing version to install provided by 'openshift_logging_mux_image_version'
+  when: not openshift_logging_mux_image_version or openshift_logging_mux_image_version == ''
 
 - set_fact:
     mux_version: "{{ __latest_mux_version }}"
-  when: openshift_logging_image_version == 'latest'
+  when: openshift_logging_mux_image_version == 'latest'
 
 # should we just assume that we will have the correct major version?
-- set_fact: mux_version="{{ openshift_logging_image_version | regex_replace('^v?(?P<major>\d)\.(?P<minor>\d).*$', '3_\\g<minor>') }}"
-  when: openshift_logging_image_version != 'latest'
+- set_fact: mux_version="{{ openshift_logging_mux_image_version | regex_replace('^v?(?P<major>\d)\.(?P<minor>\d).*$', '3_\\g<minor>') }}"
+  when: openshift_logging_mux_image_version != 'latest'
 
 - fail:
     msg: Invalid version specified for mux

+ 31 - 18
roles/openshift_logging_mux/tasks/main.yaml

@@ -7,6 +7,19 @@
     msg: Operations logs destination is required
   when: not openshift_logging_mux_ops_host or openshift_logging_mux_ops_host == ''
 
+- name: Set default image variables based on deployment_type
+  include_vars: "{{ var_file_name }}"
+  with_first_found:
+    - "{{ openshift_deployment_type | default(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) }}"
+
 - include: determine_version.yaml
 
 # allow passing in a tempdir
@@ -42,7 +55,7 @@
     name: "aggregated-logging-mux"
     namespace: "{{ openshift_logging_mux_namespace }}"
   when:
-  - openshift_logging_image_pull_secret == ''
+    - openshift_logging_image_pull_secret == ''
 
 # set service account scc
 - name: Set privileged permissions for Mux
@@ -112,14 +125,14 @@
     name: logging-mux
     namespace: "{{ openshift_logging_mux_namespace }}"
     files:
-    - name: ca
-      path: "{{ generated_certs_dir }}/ca.crt"
-    - name: key
-      path: "{{ generated_certs_dir }}/system.logging.mux.key"
-    - name: cert
-      path: "{{ generated_certs_dir }}/system.logging.mux.crt"
-    - name: shared_key
-      path: "{{ generated_certs_dir }}/mux_shared_key"
+      - name: ca
+        path: "{{ generated_certs_dir }}/ca.crt"
+      - name: key
+        path: "{{ generated_certs_dir }}/system.logging.mux.key"
+      - name: cert
+        path: "{{ generated_certs_dir }}/system.logging.mux.crt"
+      - name: shared_key
+        path: "{{ generated_certs_dir }}/mux_shared_key"
 
 # services
 - name: Set logging-mux service for external communication
@@ -133,11 +146,11 @@
     labels:
       logging-infra: 'support'
     ports:
-    - name: mux-forward
-      port: "{{ openshift_logging_mux_port }}"
-      targetPort: "mux-forward"
+      - name: mux-forward
+        port: "{{ openshift_logging_mux_port }}"
+        targetPort: "mux-forward"
     external_ips:
-    - "{{ ansible_eth0.ipv4.address }}"
+      - "{{ ansible_eth0.ipv4.address }}"
   when: openshift_logging_mux_allow_external | bool
 
 - name: Set logging-mux service for internal communication
@@ -151,9 +164,9 @@
     labels:
       logging-infra: 'support'
     ports:
-    - name: mux-forward
-      port: "{{ openshift_logging_mux_port }}"
-      targetPort: "mux-forward"
+      - name: mux-forward
+        port: "{{ openshift_logging_mux_port }}"
+        targetPort: "mux-forward"
   when: not openshift_logging_mux_allow_external | bool
 
 # create Mux DC
@@ -188,7 +201,7 @@
     selector: "{{ openshift_logging_mux_file_buffer_pvc_pv_selector }}"
     storage_class_name: "{{ openshift_logging_mux_file_buffer_pvc_storage_class_name | default('', true) }}"
   when:
-  - openshift_logging_mux_file_buffer_storage_type == "pvc"
+    - openshift_logging_mux_file_buffer_storage_type == "pvc"
 
 - name: Set logging-mux DC
   oc_obj:
@@ -197,7 +210,7 @@
     namespace: "{{ openshift_logging_mux_namespace }}"
     kind: dc
     files:
-    - "{{ tempdir }}/templates/logging-mux-dc.yaml"
+      - "{{ tempdir }}/templates/logging-mux-dc.yaml"
     delete_after: true
 
 - name: Add mux namespaces

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

@@ -0,0 +1,3 @@
+---
+__openshift_logging_mux_image_prefix: "{{ openshift_logging_image_prefix | default('docker.io/openshift/origin-') }}"
+__openshift_logging_mux_image_version: "{{ openshift_logging_image_version | default('latest') }}"

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

@@ -0,0 +1,3 @@
+---
+__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 ('v3.7') }}"