install_logging.yaml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 only be scaled down manually. Please see official documentation on how to do this."
  11. when: openshift_logging_facts.elasticsearch.deploymentconfigs | length > openshift_logging_es_cluster_size
  12. - name: Validate Elasticsearch Ops cluster size
  13. fail: msg="The openshift_logging_es_ops_cluster_size may only be scaled down manually. Please see official documentation on how to do this."
  14. when: openshift_logging_facts.elasticsearch_ops.deploymentconfigs | length > openshift_logging_es_ops_cluster_size
  15. - name: Install logging
  16. include: "{{ role_path }}/tasks/install_{{ install_component }}.yaml"
  17. when: openshift_hosted_logging_install | default(true) | bool
  18. with_items:
  19. - support
  20. - elasticsearch
  21. - kibana
  22. - curator
  23. - fluentd
  24. loop_control:
  25. loop_var: install_component
  26. - find: paths={{ mktemp.stdout }}/templates patterns=*.yaml
  27. register: object_def_files
  28. changed_when: no
  29. - slurp: src={{item}}
  30. register: object_defs
  31. with_items: "{{object_def_files.files | map(attribute='path') | list | sort}}"
  32. changed_when: no
  33. - name: Create objects
  34. include: oc_apply.yaml
  35. vars:
  36. - kubeconfig: "{{ mktemp.stdout }}/admin.kubeconfig"
  37. - namespace: "{{ openshift_logging_namespace }}"
  38. - file_name: "{{ file.source }}"
  39. - file_content: "{{ file.content | b64decode | from_yaml }}"
  40. with_items: "{{ object_defs.results }}"
  41. loop_control:
  42. loop_var: file
  43. when: not ansible_check_mode
  44. - include: update_master_config.yaml
  45. - name: Printing out objects to create
  46. debug: msg={{file.content | b64decode }}
  47. with_items: "{{ object_defs.results }}"
  48. loop_control:
  49. loop_var: file
  50. when: ansible_check_mode
  51. - name: Scaling up cluster
  52. include: start_cluster.yaml
  53. when: start_cluster | default(true) | bool