From f1aec4727384913d0c0b285c58878d299d5f6bfb Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Thu, 23 Mar 2017 17:05:54 -0400 Subject: Specify enterprise defaults for logging and metrics images --- roles/openshift_metrics/defaults/main.yaml | 2 -- roles/openshift_metrics/tasks/main.yaml | 7 +++++++ roles/openshift_metrics/vars/default_images.yml | 2 ++ roles/openshift_metrics/vars/openshift-enterprise.yml | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 roles/openshift_metrics/vars/default_images.yml create mode 100644 roles/openshift_metrics/vars/openshift-enterprise.yml (limited to 'roles/openshift_metrics') diff --git a/roles/openshift_metrics/defaults/main.yaml b/roles/openshift_metrics/defaults/main.yaml index 5921b7bb7..1d3db8a1a 100644 --- a/roles/openshift_metrics/defaults/main.yaml +++ b/roles/openshift_metrics/defaults/main.yaml @@ -1,8 +1,6 @@ --- openshift_metrics_start_cluster: True openshift_metrics_install_metrics: True -openshift_metrics_image_prefix: docker.io/openshift/origin- -openshift_metrics_image_version: latest openshift_metrics_startup_timeout: 500 openshift_metrics_hawkular_replicas: 1 diff --git a/roles/openshift_metrics/tasks/main.yaml b/roles/openshift_metrics/tasks/main.yaml index 1eebff3bf..f02906bc5 100644 --- a/roles/openshift_metrics/tasks/main.yaml +++ b/roles/openshift_metrics/tasks/main.yaml @@ -1,4 +1,11 @@ --- + +- 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: Create temp directory for doing work in on target command: mktemp -td openshift-metrics-ansible-XXXXXX register: mktemp diff --git a/roles/openshift_metrics/vars/default_images.yml b/roles/openshift_metrics/vars/default_images.yml new file mode 100644 index 000000000..9c1255dd7 --- /dev/null +++ b/roles/openshift_metrics/vars/default_images.yml @@ -0,0 +1,2 @@ +openshift_metrics_image_prefix: "{{ openshift_hosted_metrics_deployer_prefix | default('docker.io/openshift/origin-') }}" +openshift_metrics_image_version: "{{ openshift_hosted_metrics_deployer_version | default('latest') }}" diff --git a/roles/openshift_metrics/vars/openshift-enterprise.yml b/roles/openshift_metrics/vars/openshift-enterprise.yml new file mode 100644 index 000000000..6b9b644e5 --- /dev/null +++ b/roles/openshift_metrics/vars/openshift-enterprise.yml @@ -0,0 +1,2 @@ +openshift_metrics_image_prefix: "{{ openshift_hosted_metrics_deployer_prefix | default('registry.access.redhat.com/openshift3/') }}" +openshift_metrics_image_version: "{{ openshift_hosted_metrics_deployer_version | default(openshift_release | default ('3.5.0') ) }}" -- cgit v1.2.3 From c8afa7e4548e8c1baaeaf4bea3220a20ff71b7b9 Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Thu, 23 Mar 2017 17:32:17 -0400 Subject: Make linter happy --- roles/openshift_metrics/vars/default_images.yml | 1 + roles/openshift_metrics/vars/openshift-enterprise.yml | 1 + 2 files changed, 2 insertions(+) (limited to 'roles/openshift_metrics') diff --git a/roles/openshift_metrics/vars/default_images.yml b/roles/openshift_metrics/vars/default_images.yml index 9c1255dd7..7e0bdb877 100644 --- a/roles/openshift_metrics/vars/default_images.yml +++ b/roles/openshift_metrics/vars/default_images.yml @@ -1,2 +1,3 @@ +--- openshift_metrics_image_prefix: "{{ openshift_hosted_metrics_deployer_prefix | default('docker.io/openshift/origin-') }}" openshift_metrics_image_version: "{{ openshift_hosted_metrics_deployer_version | default('latest') }}" diff --git a/roles/openshift_metrics/vars/openshift-enterprise.yml b/roles/openshift_metrics/vars/openshift-enterprise.yml index 6b9b644e5..9d5d84d15 100644 --- a/roles/openshift_metrics/vars/openshift-enterprise.yml +++ b/roles/openshift_metrics/vars/openshift-enterprise.yml @@ -1,2 +1,3 @@ +--- openshift_metrics_image_prefix: "{{ openshift_hosted_metrics_deployer_prefix | default('registry.access.redhat.com/openshift3/') }}" openshift_metrics_image_version: "{{ openshift_hosted_metrics_deployer_version | default(openshift_release | default ('3.5.0') ) }}" -- cgit v1.2.3 From 22d8eccb74bd2a1da5c29c0020f1f7ba89164cdc Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Fri, 24 Mar 2017 11:17:44 -0400 Subject: Fix overriding openshift_{logging,metrics}_image_prefix --- roles/openshift_metrics/tasks/main.yaml | 5 +++++ roles/openshift_metrics/vars/default_images.yml | 4 ++-- roles/openshift_metrics/vars/openshift-enterprise.yml | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'roles/openshift_metrics') diff --git a/roles/openshift_metrics/tasks/main.yaml b/roles/openshift_metrics/tasks/main.yaml index f02906bc5..c8d222c60 100644 --- a/roles/openshift_metrics/tasks/main.yaml +++ b/roles/openshift_metrics/tasks/main.yaml @@ -6,6 +6,11 @@ - "{{ openshift_deployment_type | default(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 command: mktemp -td openshift-metrics-ansible-XXXXXX register: mktemp diff --git a/roles/openshift_metrics/vars/default_images.yml b/roles/openshift_metrics/vars/default_images.yml index 7e0bdb877..678c4104c 100644 --- a/roles/openshift_metrics/vars/default_images.yml +++ b/roles/openshift_metrics/vars/default_images.yml @@ -1,3 +1,3 @@ --- -openshift_metrics_image_prefix: "{{ openshift_hosted_metrics_deployer_prefix | default('docker.io/openshift/origin-') }}" -openshift_metrics_image_version: "{{ openshift_hosted_metrics_deployer_version | default('latest') }}" +__openshift_metrics_image_prefix: "{{ openshift_hosted_metrics_deployer_prefix | default('docker.io/openshift/origin-') }}" +__openshift_metrics_image_version: "{{ openshift_hosted_metrics_deployer_version | default('latest') }}" diff --git a/roles/openshift_metrics/vars/openshift-enterprise.yml b/roles/openshift_metrics/vars/openshift-enterprise.yml index 9d5d84d15..f28c3ce48 100644 --- a/roles/openshift_metrics/vars/openshift-enterprise.yml +++ b/roles/openshift_metrics/vars/openshift-enterprise.yml @@ -1,3 +1,3 @@ --- -openshift_metrics_image_prefix: "{{ openshift_hosted_metrics_deployer_prefix | default('registry.access.redhat.com/openshift3/') }}" -openshift_metrics_image_version: "{{ openshift_hosted_metrics_deployer_version | default(openshift_release | default ('3.5.0') ) }}" +__openshift_metrics_image_prefix: "{{ openshift_hosted_metrics_deployer_prefix | default('registry.access.redhat.com/openshift3/') }}" +__openshift_metrics_image_version: "{{ openshift_hosted_metrics_deployer_version | default(openshift_release | default ('3.5.0') ) }}" -- cgit v1.2.3 From a674eb52df90f2dba9b8713760dba2a9e3fed7ce Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Fri, 24 Mar 2017 13:34:00 -0400 Subject: Found this while searching the metrics role for logging, is this wrong? --- roles/openshift_metrics/templates/pvc.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'roles/openshift_metrics') diff --git a/roles/openshift_metrics/templates/pvc.j2 b/roles/openshift_metrics/templates/pvc.j2 index 885dd368d..c2e56ba21 100644 --- a/roles/openshift_metrics/templates/pvc.j2 +++ b/roles/openshift_metrics/templates/pvc.j2 @@ -4,7 +4,7 @@ metadata: name: "{{obj_name}}" {% if labels is not defined %} labels: - logging-infra: support + metrics-infra: support {% elif labels %} labels: {% for key, value in labels.iteritems() %} -- cgit v1.2.3