summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2017-02-09 13:55:40 -0500
committerRich Megginson <rmeggins@redhat.com>2017-02-09 18:23:46 -0700
commit5243b91ee3eef10cb4fa7f21d4de09c48641a0b0 (patch)
treee00b9aa0d6b6afe62586f9df77c8e59371c0830a /roles
parent9e92660ed86623385e48c4960f4db681d86a7a57 (diff)
downloadopenshift-5243b91ee3eef10cb4fa7f21d4de09c48641a0b0.tar.gz
openshift-5243b91ee3eef10cb4fa7f21d4de09c48641a0b0.tar.bz2
openshift-5243b91ee3eef10cb4fa7f21d4de09c48641a0b0.tar.xz
openshift-5243b91ee3eef10cb4fa7f21d4de09c48641a0b0.zip
make sure cluster_size is an int for arith. ops
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_logging/tasks/generate_pvcs.yaml4
-rw-r--r--roles/openshift_logging/tasks/install_elasticsearch.yaml8
-rw-r--r--roles/openshift_logging/tasks/install_logging.yaml4
-rw-r--r--roles/openshift_logging/vars/main.yaml12
4 files changed, 14 insertions, 14 deletions
diff --git a/roles/openshift_logging/tasks/generate_pvcs.yaml b/roles/openshift_logging/tasks/generate_pvcs.yaml
index 601ec9e83..d782d621e 100644
--- a/roles/openshift_logging/tasks/generate_pvcs.yaml
+++ b/roles/openshift_logging/tasks/generate_pvcs.yaml
@@ -4,10 +4,10 @@
vars:
pvc_name: "{{openshift_logging_es_pvc_prefix}}-{{item| int}}"
start: "{{es_pvc_names | map('regex_search',openshift_logging_es_pvc_prefix+'.*')|select('string')|list|length}}"
- with_sequence: start={{start}} end={{ (start|int > openshift_logging_es_cluster_size - 1) | ternary(start, openshift_logging_es_cluster_size - 1)}}
+ with_sequence: start={{start}} end={{ (start|int > openshift_logging_es_cluster_size|int - 1) | ternary(start, openshift_logging_es_cluster_size|int - 1)}}
when:
- openshift_logging_es_pvc_size | search('^\d.*')
- - "{{ es_dc_names|default([]) | length < openshift_logging_es_cluster_size }}"
+ - "{{ es_dc_names|default([]) | length < openshift_logging_es_cluster_size|int }}"
check_mode: no
- name: Generating PersistentVolumeClaims
diff --git a/roles/openshift_logging/tasks/install_elasticsearch.yaml b/roles/openshift_logging/tasks/install_elasticsearch.yaml
index 1d6e55e44..f9c2c81fb 100644
--- a/roles/openshift_logging/tasks/install_elasticsearch.yaml
+++ b/roles/openshift_logging/tasks/install_elasticsearch.yaml
@@ -54,10 +54,10 @@
fail: msg="The openshift_logging_es_ops_cluster_size may not be scaled down more than 1 less (or 0) the number of Elasticsearch nodes already deployed"
vars:
es_dcs: "{{openshift_logging_facts.elasticsearch_ops.deploymentconfigs}}"
- cluster_size: "{{openshift_logging_es_ops_cluster_size}}"
+ cluster_size: "{{openshift_logging_es_ops_cluster_size|int}}"
when:
- openshift_logging_use_ops | bool
- - "{{es_dcs | length - openshift_logging_es_ops_cluster_size | abs > 1}}"
+ - "{{es_dcs | length - openshift_logging_es_ops_cluster_size|int | abs > 1}}"
check_mode: no
- name: Generate PersistentVolumeClaims for Ops
@@ -66,7 +66,7 @@
es_pvc_names: "{{openshift_logging_facts.elasticsearch_ops.pvcs.keys()}}"
es_dc_names: "{{openshift_logging_facts.elasticsearch_ops.deploymentconfigs.keys()}}"
openshift_logging_es_pvc_prefix: "{{openshift_logging_es_ops_pvc_prefix}}"
- openshift_logging_es_cluster_size: "{{openshift_logging_es_ops_cluster_size}}"
+ openshift_logging_es_cluster_size: "{{openshift_logging_es_ops_cluster_size|int}}"
openshift_logging_es_pvc_size: "{{openshift_logging_es_ops_pvc_size}}"
openshift_logging_es_pvc_dynamic: "{{openshift_logging_es_ops_pvc_dynamic}}"
openshift_logging_es_pv_selector: "{{openshift_logging_es_ops_pv_selector}}"
@@ -89,7 +89,7 @@
es_cluster_name: "{{component}}"
deploy_name_prefix: "logging-{{component}}"
deploy_name: "{{deploy_name_prefix}}-{{'abcdefghijklmnopqrstuvwxyz0123456789'|random_word(8)}}"
- cluster_size: "{{openshift_logging_es_ops_cluster_size}}"
+ cluster_size: "{{openshift_logging_es_ops_cluster_size|int}}"
with_sequence: count={{ openshift_logging_es_ops_cluster_size | int - openshift_logging_current_es_ops_size | int }}
when:
- openshift_logging_use_ops | bool
diff --git a/roles/openshift_logging/tasks/install_logging.yaml b/roles/openshift_logging/tasks/install_logging.yaml
index d52429f03..e23c3f9f1 100644
--- a/roles/openshift_logging/tasks/install_logging.yaml
+++ b/roles/openshift_logging/tasks/install_logging.yaml
@@ -9,11 +9,11 @@
- name: Validate Elasticsearch cluster size
fail: msg="The openshift_logging_es_cluster_size may only be scaled down manually. Please see official documentation on how to do this."
- when: openshift_logging_facts.elasticsearch.deploymentconfigs | length > openshift_logging_es_cluster_size
+ when: openshift_logging_facts.elasticsearch.deploymentconfigs | length > openshift_logging_es_cluster_size|int
- name: Validate Elasticsearch Ops cluster size
fail: msg="The openshift_logging_es_ops_cluster_size may only be scaled down manually. Please see official documentation on how to do this."
- when: openshift_logging_facts.elasticsearch_ops.deploymentconfigs | length > openshift_logging_es_ops_cluster_size
+ when: openshift_logging_facts.elasticsearch_ops.deploymentconfigs | length > openshift_logging_es_ops_cluster_size|int
- name: Install logging
include: "{{ role_path }}/tasks/install_{{ install_component }}.yaml"
diff --git a/roles/openshift_logging/vars/main.yaml b/roles/openshift_logging/vars/main.yaml
index 11662c446..07cc05683 100644
--- a/roles/openshift_logging/vars/main.yaml
+++ b/roles/openshift_logging/vars/main.yaml
@@ -1,8 +1,8 @@
---
openshift_master_config_dir: "{{ openshift.common.config_base }}/master"
-es_node_quorum: "{{openshift_logging_es_cluster_size/2 + 1}}"
-es_recover_after_nodes: "{{openshift_logging_es_cluster_size - 1}}"
-es_recover_expected_nodes: "{{openshift_logging_es_cluster_size}}"
-es_ops_node_quorum: "{{openshift_logging_es_ops_cluster_size/2 + 1}}"
-es_ops_recover_after_nodes: "{{openshift_logging_es_ops_cluster_size - 1}}"
-es_ops_recover_expected_nodes: "{{openshift_logging_es_ops_cluster_size}}"
+es_node_quorum: "{{openshift_logging_es_cluster_size|int/2 + 1}}"
+es_recover_after_nodes: "{{openshift_logging_es_cluster_size|int - 1}}"
+es_recover_expected_nodes: "{{openshift_logging_es_cluster_size|int}}"
+es_ops_node_quorum: "{{openshift_logging_es_ops_cluster_size|int/2 + 1}}"
+es_ops_recover_after_nodes: "{{openshift_logging_es_ops_cluster_size|int - 1}}"
+es_ops_recover_expected_nodes: "{{openshift_logging_es_ops_cluster_size|int}}"