You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
943 B

  1. ---
  2. - name: "Fluentd | Write fluentd daemonset"
  3. template:
  4. src: fluentd-ds.yml.j2
  5. dest: "{{ kube_config_dir }}/fluentd-ds.yaml"
  6. register: fluentd_ds_manifest
  7. #FIXME: remove if kubernetes/features#124 is implemented
  8. - name: "Fluentd | Purge old fluentd daemonset"
  9. kube:
  10. filename: "{{kube_config_dir}}/fluentd-ds.yaml"
  11. kubectl: "{{bin_dir}}/kubectl"
  12. name: "fluentd-es-v{{ fluentd_version }}"
  13. namespace: "{{system_namespace}}"
  14. resource: "ds"
  15. state: absent
  16. when: inventory_hostname == groups['kube-master'][0] and fluentd_ds_manifest.changed
  17. - name: "Fluentd | Create fluentd daemonset"
  18. kube:
  19. filename: "{{kube_config_dir}}/fluentd-ds.yaml"
  20. kubectl: "{{bin_dir}}/kubectl"
  21. name: "fluentd-es-v{{ fluentd_version }}"
  22. namespace: "{{system_namespace}}"
  23. resource: "ds"
  24. state: "{{ item | ternary('latest','present') }}"
  25. with_items: "{{ fluentd_ds_manifest.changed }}"
  26. run_once: true