123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- ---
- - name: Gather OpenShift Logging Facts
- openshift_logging_facts:
- oc_bin: "{{openshift.common.client_binary}}"
- openshift_logging_namespace: "{{openshift_logging_namespace}}"
- - name: Set logging project
- oc_project:
- state: present
- name: "{{ openshift_logging_namespace }}"
- - name: Install logging mux
- include: "{{ role_path }}/tasks/install_mux.yaml"
- when: openshift_logging_use_mux
- - find: paths={{ mktemp.stdout }}/templates patterns=*.yaml
- register: object_def_files
- changed_when: no
- - name: Create logging cert directory
- file:
- path: "{{ openshift.common.config_base }}/logging"
- state: directory
- mode: 0755
- changed_when: False
- check_mode: no
- - include: generate_certs.yaml
- vars:
- generated_certs_dir: "{{openshift.common.config_base}}/logging"
- ## Elasticsearch
- # TODO: add more vars
- # We don't allow scaling down of ES nodes currently
- - include_role:
- name: openshift_logging_elasticsearch
- vars:
- generated_certs_dir: "{{openshift.common.config_base}}/logging"
- openshift_logging_elasticsearch_deployment_name: "{{ item.0 }}"
- openshift_logging_elasticsearch_pvc_name: "{{ item.1 }}"
- openshift_logging_elasticsearch_replica_count: "{{ openshift_logging_es_cluster_size | int }}"
- #openshift_logging_elasticsearch_storage_type: "{{ }}"
- openshift_logging_elasticsearch_pvc_size: "{{ openshift_logging_es_pvc_size }}"
- openshift_logging_elasticsearch_pvc_dynamic: "{{ openshift_logging_es_pvc_dynamic }}"
- openshift_logging_elasticsearch_pvc_pv_selector: "{{ openshift_logging_es_pv_selector }}"
- with_together:
- - "{{ openshift_logging_facts.elasticsearch.deploymentconfigs }}"
- - "{{ openshift_logging_facts.elasticsearch.pvcs }}"
- # Create any new DC that may be required
- - include_role:
- name: openshift_logging_elasticsearch
- vars:
- generated_certs_dir: "{{openshift.common.config_base}}/logging"
- openshift_logging_elasticsearch_pvc_name: "{{ openshift_logging_es_pvc_prefix }}-{{ item | int + openshift_logging_facts.elasticsearch.deploymentconfigs | count }}"
- openshift_logging_elasticsearch_replica_count: "{{ openshift_logging_es_cluster_size | int }}"
- with_sequence: count={{ openshift_logging_es_cluster_size | int - openshift_logging_facts.elasticsearch.deploymentconfigs.keys() | count }}
- # TODO: add more vars
- - include_role:
- name: openshift_logging_elasticsearch
- vars:
- generated_certs_dir: "{{openshift.common.config_base}}/logging"
- openshift_logging_elasticsearch_deployment_name: "{{ item.0 }}"
- openshift_logging_elasticsearch_pvc_name: "{{ item.1 }}"
- openshift_logging_elasticsearch_ops_deployment: true
- openshift_logging_elasticsearch_replica_count: "{{ openshift_logging_es_ops_cluster_size | int }}"
- #openshift_logging_elasticsearch_storage_type: "{{ }}"
- openshift_logging_elasticsearch_pvc_size: "{{ openshift_logging_es_pvc_size }}"
- openshift_logging_elasticsearch_pvc_dynamic: "{{ openshift_logging_es_pvc_dynamic }}"
- openshift_logging_elasticsearch_pvc_pv_selector: "{{ openshift_logging_es_pv_selector }}"
- with_together:
- - "{{ openshift_logging_facts.elasticsearch_ops.deploymentconfigs }}"
- - "{{ openshift_logging_facts.elasticsearch_ops.pvcs }}"
- when:
- - openshift_logging_use_ops | bool
- # Create any new DC that may be required
- - include_role:
- name: openshift_logging_elasticsearch
- vars:
- generated_certs_dir: "{{openshift.common.config_base}}/logging"
- openshift_logging_elasticsearch_pvc_name: "{{ openshift_logging_es_pvc_prefix }}-{{ item | int + openshift_logging_facts.elasticsearch_ops.deploymentconfigs | count }}"
- openshift_logging_elasticsearch_ops_deployment: true
- openshift_logging_elasticsearch_replica_count: "{{ openshift_logging_es_ops_cluster_size | int }}"
- with_sequence: count={{ ( ( openshift_logging_es_ops_cluster_size | int ) - ( openshift_logging_facts.elasticsearch_ops.deploymentconfigs.keys() | count ) ) }}
- when:
- - openshift_logging_use_ops | bool
- ## Kibana
- - include_role:
- name: openshift_logging_kibana
- vars:
- generated_certs_dir: "{{openshift.common.config_base}}/logging"
- openshift_logging_kibana_namespace: "{{ openshift_logging_namespace }}"
- openshift_logging_kibana_master_url: "{{ openshift_logging_master_url }}"
- openshift_logging_kibana_master_public_url: "{{ openshift_logging_master_public_url }}"
- openshift_logging_kibana_image_prefix: "{{ openshift_logging_image_prefix }}"
- openshift_logging_kibana_image_version: "{{ openshift_logging_image_version }}"
- openshift_logging_kibana_replicas: "{{ openshift_logging_kibana_replica_count }}"
- openshift_logging_kibana_es_host: "{{ openshift_logging_es_host }}"
- openshift_logging_kibana_es_port: "{{ openshift_logging_es_port }}"
- openshift_logging_kibana_image_pull_secret: "{{ openshift_logging_image_pull_secret }}"
- - include_role:
- name: openshift_logging_kibana
- vars:
- generated_certs_dir: "{{openshift.common.config_base}}/logging"
- openshift_logging_kibana_ops_deployment: true
- openshift_logging_kibana_namespace: "{{ openshift_logging_namespace }}"
- openshift_logging_kibana_master_url: "{{ openshift_logging_master_url }}"
- openshift_logging_kibana_master_public_url: "{{ openshift_logging_master_public_url }}"
- openshift_logging_kibana_image_prefix: "{{ openshift_logging_image_prefix }}"
- openshift_logging_kibana_image_version: "{{ openshift_logging_image_version }}"
- openshift_logging_kibana_image_pull_secret: "{{ openshift_logging_image_pull_secret }}"
- openshift_logging_kibana_es_host: "{{ openshift_logging_es_ops_host }}"
- openshift_logging_kibana_es_port: "{{ openshift_logging_es_ops_port }}"
- openshift_logging_kibana_nodeselector: "{{ openshift_logging_kibana_ops_nodeselector }}"
- openshift_logging_kibana_cpu_limit: "{{ openshift_logging_kibana_ops_cpu_limit }}"
- openshift_logging_kibana_memory_limit: "{{ openshift_logging_kibana_ops_memory_limit }}"
- openshift_logging_kibana_hostname: "{{ openshift_logging_kibana_ops_hostname }}"
- openshift_logging_kibana_replicas: "{{ openshift_logging_kibana_ops_replica_count }}"
- openshift_logging_kibana_proxy_debug: "{{ openshift_logging_kibana_ops_proxy_debug }}"
- openshift_logging_kibana_proxy_cpu_limit: "{{ openshift_logging_kibana_ops_proxy_cpu_limit }}"
- openshift_logging_kibana_proxy_memory_limit: "{{ openshift_logging_kibana_ops_proxy_memory_limit }}"
- openshift_logging_kibana_cert: "{{ openshift_logging_kibana_ops_cert }}"
- openshift_logging_kibana_key: "{{ openshift_logging_kibana_ops_key }}"
- openshift_logging_kibana_ca: "{{ openshift_logging_kibana_ops_ca}}"
- when:
- - openshift_logging_use_ops | bool
- ## Curator
- - include_role:
- name: openshift_logging_curator
- vars:
- generated_certs_dir: "{{openshift.common.config_base}}/logging"
- openshift_logging_curator_namespace: "{{ openshift_logging_namespace }}"
- openshift_logging_curator_master_url: "{{ openshift_logging_master_url }}"
- openshift_logging_curator_image_prefix: "{{ openshift_logging_image_prefix }}"
- openshift_logging_curator_image_version: "{{ openshift_logging_image_version }}"
- openshift_logging_curator_image_pull_secret: "{{ openshift_logging_image_pull_secret }}"
- - include_role:
- name: openshift_logging_curator
- vars:
- generated_certs_dir: "{{openshift.common.config_base}}/logging"
- openshift_logging_curator_ops_deployment: true
- openshift_logging_curator_namespace: "{{ openshift_logging_namespace }}"
- openshift_logging_curator_master_url: "{{ openshift_logging_master_url }}"
- openshift_logging_curator_image_prefix: "{{ openshift_logging_image_prefix }}"
- openshift_logging_curator_image_version: "{{ openshift_logging_image_version }}"
- openshift_logging_curator_image_pull_secret: "{{ openshift_logging_image_pull_secret }}"
- openshift_logging_curator_cpu_limit: "{{ openshift_logging_curator_ops_cpu_limit }}"
- openshift_logging_curator_memory_limit: "{{ openshift_logging_curator_ops_memory_limit }}"
- openshift_logging_curator_nodeselector: "{{ openshift_logging_curator_ops_nodeselector }}"
- when:
- - openshift_logging_use_ops | bool
- ## Fluentd
- - include_role:
- name: openshift_logging_fluentd
- vars:
- generated_certs_dir: "{{openshift.common.config_base}}/logging"
- openshift_logging_fluentd_ops_host: "{{ ( openshift_logging_use_ops | bool ) | ternary('logging-es-ops', 'logging-es') }}"
- openshift_logging_fluentd_use_journal: "{{ openshift.docker.options | search('journald') }}"
- - include: update_master_config.yaml
|