2017-01-27 07:33:01 +08:00
|
|
|
---
|
|
|
|
- name: "Fluentd | Write fluentd daemonset"
|
2017-02-08 22:13:17 +08:00
|
|
|
template:
|
2017-01-27 07:33:01 +08:00
|
|
|
src: fluentd-ds.yml.j2
|
|
|
|
dest: "{{ kube_config_dir }}/fluentd-ds.yaml"
|
|
|
|
register: fluentd_ds_manifest
|
|
|
|
|
2017-02-08 22:13:17 +08:00
|
|
|
#FIXME: remove if kubernetes/features#124 is implemented
|
|
|
|
- name: "Fluentd | Purge old fluentd daemonset"
|
|
|
|
kube:
|
|
|
|
filename: "{{kube_config_dir}}/fluentd-ds.yaml"
|
|
|
|
kubectl: "{{bin_dir}}/kubectl"
|
|
|
|
name: "fluentd-es-v{{ fluentd_version }}"
|
|
|
|
namespace: "{{system_namespace}}"
|
|
|
|
resource: "ds"
|
|
|
|
state: absent
|
|
|
|
when: inventory_hostname == groups['kube-master'][0] and fluentd_ds_manifest.changed
|
|
|
|
|
2017-01-27 07:33:01 +08:00
|
|
|
- name: "Fluentd | Create fluentd daemonset"
|
|
|
|
kube:
|
|
|
|
filename: "{{kube_config_dir}}/fluentd-ds.yaml"
|
|
|
|
kubectl: "{{bin_dir}}/kubectl"
|
|
|
|
name: "fluentd-es-v{{ fluentd_version }}"
|
|
|
|
namespace: "{{system_namespace}}"
|
|
|
|
resource: "ds"
|
|
|
|
state: "{{ item | ternary('latest','present') }}"
|
|
|
|
with_items: "{{ fluentd_ds_manifest.changed }}"
|
|
|
|
run_once: true
|