install_logging.yaml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. ---
  2. - name: Gather OpenShift Logging Facts
  3. openshift_logging_facts:
  4. oc_bin: "{{openshift.common.client_binary}}"
  5. admin_kubeconfig: "{{mktemp.stdout}}/admin.kubeconfig"
  6. openshift_logging_namespace: "{{openshift_logging_namespace}}"
  7. tags: logging_facts
  8. check_mode: no
  9. - name: Validate Elasticsearch cluster size
  10. fail: msg="The openshift_logging_es_cluster_size may not be scaled down more than 1 less (or 0) the number of Elasticsearch nodes already deployed"
  11. when: "{{openshift_logging_facts.elasticsearch.deploymentconfigs | length - openshift_logging_es_cluster_size | abs > 1}}"
  12. - name: Install logging
  13. include: "{{ role_path }}/tasks/install_{{ install_component }}.yaml"
  14. when: openshift_hosted_logging_install | default(true) | bool
  15. with_items:
  16. - support
  17. - elasticsearch
  18. - kibana
  19. - curator
  20. - fluentd
  21. loop_control:
  22. loop_var: install_component
  23. - name: Create objects
  24. include: oc_apply.yaml
  25. vars:
  26. - kubeconfig: "{{ mktemp.stdout }}/admin.kubeconfig"
  27. - namespace: "{{ openshift_logging_namespace }}"
  28. - file_name: "{{ file }}"
  29. - file_content: "{{ lookup('file', file) | from_yaml }}"
  30. with_fileglob:
  31. - "{{ mktemp.stdout }}/templates/*.yaml"
  32. loop_control:
  33. loop_var: file
  34. when: not ansible_check_mode
  35. - name: Printing out objects to create
  36. debug: msg="{{lookup('file', file)|quote}}"
  37. with_fileglob:
  38. - "{{mktemp.stdout}}/templates/*.yaml"
  39. loop_control:
  40. loop_var: file
  41. when: ansible_check_mode
  42. - name: Scaling up cluster
  43. include: start_cluster.yaml
  44. when: start_cluster | default(true) | bool