From 7c72a665d9391a1597fe192fa88d6d0a50058185 Mon Sep 17 00:00:00 2001 From: ewolinetz Date: Fri, 3 Mar 2017 17:26:44 -0600 Subject: Adding some more logging defaults --- roles/openshift_logging/tasks/generate_pvcs.yaml | 4 ++-- roles/openshift_logging/tasks/install_elasticsearch.yaml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'roles/openshift_logging/tasks') diff --git a/roles/openshift_logging/tasks/generate_pvcs.yaml b/roles/openshift_logging/tasks/generate_pvcs.yaml index d6d1abd06..20c7277e3 100644 --- a/roles/openshift_logging/tasks/generate_pvcs.yaml +++ b/roles/openshift_logging/tasks/generate_pvcs.yaml @@ -16,7 +16,7 @@ obj_name: "{{claim_name}}" size: "{{es_pvc_size}}" access_modes: - - ReadWriteOnce + - "{{ es_access_modes }}" pv_selector: "{{es_pv_selector}}" with_items: - "{{es_pvc_pool | default([])}}" @@ -36,7 +36,7 @@ volume.alpha.kubernetes.io/storage-class: "dynamic" size: "{{es_pvc_size}}" access_modes: - - ReadWriteOnce + - "{{ es_access_modes }}" pv_selector: "{{es_pv_selector}}" with_items: - "{{es_pvc_pool|default([])}}" diff --git a/roles/openshift_logging/tasks/install_elasticsearch.yaml b/roles/openshift_logging/tasks/install_elasticsearch.yaml index 6b441c4aa..2941ecbfe 100644 --- a/roles/openshift_logging/tasks/install_elasticsearch.yaml +++ b/roles/openshift_logging/tasks/install_elasticsearch.yaml @@ -12,6 +12,7 @@ es_pvc_size: "{{openshift_logging_es_pvc_size}}" es_dc_names: "{{openshift_logging_facts.elasticsearch.deploymentconfigs.keys()}}" es_cluster_size: "{{openshift_logging_es_cluster_size}}" + es_access_modes: "{{ openshift_logging_storage_access_modes }}" # we should initialize the es_dc_pool with the current keys - name: Init pool of DeploymentConfig names for Elasticsearch @@ -77,6 +78,7 @@ es_cluster_size: "{{openshift_logging_es_ops_cluster_size|int}}" es_pvc_dynamic: "{{openshift_logging_es_ops_pvc_dynamic | bool}}" es_pv_selector: "{{openshift_logging_es_ops_pv_selector}}" + es_access_modes: "{{ openshift_logging_storage_access_modes }}" when: - openshift_logging_use_ops | bool check_mode: no -- cgit v1.2.3 From e10f7af55a3c311870eb65ac1ec4dd6c511ab5c0 Mon Sep 17 00:00:00 2001 From: ewolinetz Date: Tue, 7 Mar 2017 12:17:23 -0600 Subject: Fixing plugin, nodeselectors, and secret pull check --- roles/openshift_logging/tasks/install_curator.yaml | 2 +- roles/openshift_logging/tasks/install_elasticsearch.yaml | 8 ++++++-- roles/openshift_logging/tasks/install_kibana.yaml | 4 ++-- roles/openshift_logging/tasks/install_logging.yaml | 4 +++- 4 files changed, 12 insertions(+), 6 deletions(-) (limited to 'roles/openshift_logging/tasks') diff --git a/roles/openshift_logging/tasks/install_curator.yaml b/roles/openshift_logging/tasks/install_curator.yaml index 5b474ff39..ab8e207f1 100644 --- a/roles/openshift_logging/tasks/install_curator.yaml +++ b/roles/openshift_logging/tasks/install_curator.yaml @@ -31,7 +31,7 @@ curator_cpu_limit: "{{openshift_logging_curator_cpu_limit }}" curator_memory_limit: "{{openshift_logging_curator_memory_limit }}" replicas: "{{curator_replica_count.stdout | default (0)}}" - curator_node_selector: "{{openshift_logging_curator_nodeselector | default({}) }}" + curator_node_selector: "{{openshift_logging_curator_nodeselector | default({})}}" check_mode: no changed_when: no diff --git a/roles/openshift_logging/tasks/install_elasticsearch.yaml b/roles/openshift_logging/tasks/install_elasticsearch.yaml index 2941ecbfe..e908e802c 100644 --- a/roles/openshift_logging/tasks/install_elasticsearch.yaml +++ b/roles/openshift_logging/tasks/install_elasticsearch.yaml @@ -32,6 +32,10 @@ with_sequence: count={{ openshift_logging_es_cluster_size | int - openshift_logging_current_es_size | int }} check_mode: no +- set_fact: nodeselector="{{openshift_logging_es_nodeselector | default({}) }}" + +- debug: var=nodeselector + - name: Generate Elasticsearch DeploymentConfig template: src=es.j2 dest={{mktemp.stdout}}/templates/logging-{{deploy_name}}-dc.yaml vars: @@ -45,7 +49,7 @@ volume_names: "{{es_pvc_pool | default([])}}" pvc_claim: "{{(volume_names | length > item.0) | ternary(volume_names[item.0], None)}}" deploy_name: "{{item.1}}" - es_node_selector: "{{openshift_logging_es_nodeselector | default({})}}" + es_node_selector: "{{openshift_logging_es_nodeselector | default({}) }}" with_indexed_items: - "{{ es_dc_pool }}" check_mode: no @@ -121,7 +125,7 @@ es_recover_after_nodes: "{{es_ops_recover_after_nodes}}" es_recover_expected_nodes: "{{es_ops_recover_expected_nodes}}" openshift_logging_es_recover_after_time: "{{openshift_logging_es_ops_recover_after_time}}" - es_node_selector: "{{openshift_logging_es_ops_nodeselector | default({})}}" + es_node_selector: "{{openshift_logging_es_ops_nodeselector | default({}) | map_from_pairs }}" with_indexed_items: - "{{ es_ops_dc_pool | default([]) }}" when: diff --git a/roles/openshift_logging/tasks/install_kibana.yaml b/roles/openshift_logging/tasks/install_kibana.yaml index 3aeff2cac..52bdeb50d 100644 --- a/roles/openshift_logging/tasks/install_kibana.yaml +++ b/roles/openshift_logging/tasks/install_kibana.yaml @@ -35,7 +35,7 @@ kibana_proxy_cpu_limit: "{{openshift_logging_kibana_proxy_cpu_limit }}" kibana_proxy_memory_limit: "{{openshift_logging_kibana_proxy_memory_limit }}" replicas: "{{kibana_replica_count.stdout | default (0)}}" - kibana_node_selector: "{{openshift_logging_kibana_nodeselector | default({}) }}" + kibana_node_selector: "{{openshift_logging_kibana_nodeselector | default({})}}" check_mode: no changed_when: no @@ -54,7 +54,7 @@ kibana_proxy_cpu_limit: "{{openshift_logging_kibana_ops_proxy_cpu_limit }}" kibana_proxy_memory_limit: "{{openshift_logging_kibana_ops_proxy_memory_limit }}" replicas: "{{kibana_ops_replica_count.stdout | default (0)}}" - kibana_node_selector: "{{openshift_logging_kibana_ops_nodeselector | default({}) }}" + kibana_node_selector: "{{openshift_logging_kibana_ops_nodeselector | default({})}}" when: openshift_logging_use_ops | bool check_mode: no changed_when: no diff --git a/roles/openshift_logging/tasks/install_logging.yaml b/roles/openshift_logging/tasks/install_logging.yaml index e23c3f9f1..59ba05da3 100644 --- a/roles/openshift_logging/tasks/install_logging.yaml +++ b/roles/openshift_logging/tasks/install_logging.yaml @@ -76,7 +76,9 @@ register: link_pull_secret loop_control: loop_var: sa_account - when: openshift_logging_image_pull_secret is defined + when: + - openshift_logging_image_pull_secret is defined + - openshift_logging_image_pull_secret is not None failed_when: link_pull_secret.rc != 0 - name: Scaling up cluster -- cgit v1.2.3 From ab88af6414729556cabf4bde7cbb4ea83b183e3f Mon Sep 17 00:00:00 2001 From: ewolinetz Date: Tue, 7 Mar 2017 18:18:45 -0600 Subject: More logging fixes --- roles/openshift_logging/tasks/generate_pvcs.yaml | 2 +- roles/openshift_logging/tasks/install_elasticsearch.yaml | 4 ---- roles/openshift_logging/tasks/install_logging.yaml | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) (limited to 'roles/openshift_logging/tasks') diff --git a/roles/openshift_logging/tasks/generate_pvcs.yaml b/roles/openshift_logging/tasks/generate_pvcs.yaml index 20c7277e3..e1629908f 100644 --- a/roles/openshift_logging/tasks/generate_pvcs.yaml +++ b/roles/openshift_logging/tasks/generate_pvcs.yaml @@ -6,8 +6,8 @@ start: "{{es_pvc_names | map('regex_search', es_pvc_prefix+'.*')|select('string')|list|length}}" with_sequence: start={{start}} end={{ (start|int > es_cluster_size|int - 1) | ternary(start, es_cluster_size|int - 1)}} when: + - "{{ es_dc_names|default([]) | length <= es_cluster_size|int }}" - es_pvc_size | search('^\d.*') - - "{{ es_dc_names|default([]) | length < 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 e908e802c..a0ad12d94 100644 --- a/roles/openshift_logging/tasks/install_elasticsearch.yaml +++ b/roles/openshift_logging/tasks/install_elasticsearch.yaml @@ -32,10 +32,6 @@ with_sequence: count={{ openshift_logging_es_cluster_size | int - openshift_logging_current_es_size | int }} check_mode: no -- set_fact: nodeselector="{{openshift_logging_es_nodeselector | default({}) }}" - -- debug: var=nodeselector - - name: Generate Elasticsearch DeploymentConfig template: src=es.j2 dest={{mktemp.stdout}}/templates/logging-{{deploy_name}}-dc.yaml vars: diff --git a/roles/openshift_logging/tasks/install_logging.yaml b/roles/openshift_logging/tasks/install_logging.yaml index 59ba05da3..1beff3bfc 100644 --- a/roles/openshift_logging/tasks/install_logging.yaml +++ b/roles/openshift_logging/tasks/install_logging.yaml @@ -78,7 +78,7 @@ loop_var: sa_account when: - openshift_logging_image_pull_secret is defined - - openshift_logging_image_pull_secret is not None + - openshift_logging_image_pull_secret != '' failed_when: link_pull_secret.rc != 0 - name: Scaling up cluster -- cgit v1.2.3