main.yaml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. ---
  2. - fail:
  3. msg: Only one Fluentd nodeselector key pair should be provided
  4. when: "{{ openshift_logging_fluentd_nodeselector.keys() | count }} > 1"
  5. - name: Set default image variables based on deployment_type
  6. include_vars: "{{ item }}"
  7. with_first_found:
  8. - "{{ openshift_deployment_type | default(deployment_type) }}.yml"
  9. - "default_images.yml"
  10. - name: Create temp directory for doing work in
  11. command: mktemp -d /tmp/openshift-logging-ansible-XXXXXX
  12. register: mktemp
  13. changed_when: False
  14. check_mode: no
  15. tags: logging_init
  16. - debug: msg="Created temp dir {{mktemp.stdout}}"
  17. - name: Create local temp directory for doing work in
  18. local_action: command mktemp -d /tmp/openshift-logging-ansible-XXXXXX
  19. register: local_tmp
  20. changed_when: False
  21. check_mode: no
  22. - debug: msg="Created local temp dir {{local_tmp.stdout}}"
  23. - name: Copy the admin client config(s)
  24. command: >
  25. cp {{ openshift_master_config_dir }}/admin.kubeconfig {{ mktemp.stdout }}/admin.kubeconfig
  26. changed_when: False
  27. check_mode: no
  28. tags: logging_init
  29. - include: "{{ role_path }}/tasks/install_logging.yaml"
  30. when: openshift_logging_install_logging | default(false) | bool
  31. - include: "{{ role_path }}/tasks/upgrade_logging.yaml"
  32. when: openshift_logging_upgrade_logging | default(false) | bool
  33. - include: "{{ role_path }}/tasks/delete_logging.yaml"
  34. when:
  35. - not openshift_logging_install_logging | default(false) | bool
  36. - not openshift_logging_upgrade_logging | default(false) | bool
  37. - name: Delete temp directory
  38. file:
  39. name: "{{ mktemp.stdout }}"
  40. state: absent
  41. tags: logging_cleanup
  42. changed_when: False
  43. check_mode: no
  44. - name: Cleaning up local temp dir
  45. local_action: file path="{{local_tmp.stdout}}" state=absent
  46. tags: logging_cleanup
  47. changed_when: False