diff options
author | Jhon Honce <jhonce@redhat.com> | 2015-06-01 16:00:11 -0700 |
---|---|---|
committer | Jhon Honce <jhonce@redhat.com> | 2015-06-01 16:00:11 -0700 |
commit | 433e3c77adf99cfaa5d6b8f94d2f0065f187b0fc (patch) | |
tree | a1e01051d2e971364c4415a673a6c8683b80d2fb /roles/fluentd_master | |
parent | 92524d99ddcb5365bebf3e73e32ab604581d0fd9 (diff) | |
parent | 3f486ba15524ece60a2e211416535ca3d40708bc (diff) | |
download | openshift-433e3c77adf99cfaa5d6b8f94d2f0065f187b0fc.tar.gz openshift-433e3c77adf99cfaa5d6b8f94d2f0065f187b0fc.tar.bz2 openshift-433e3c77adf99cfaa5d6b8f94d2f0065f187b0fc.tar.xz openshift-433e3c77adf99cfaa5d6b8f94d2f0065f187b0fc.zip |
Merge pull request #190 from jwhonce/wip/containers
Infrastructure - Deploy services in cluster
@twiest All comments covered.
Diffstat (limited to 'roles/fluentd_master')
-rw-r--r-- | roles/fluentd_master/tasks/main.yml | 46 | ||||
-rw-r--r-- | roles/fluentd_master/templates/kubernetes.conf.j2 | 9 |
2 files changed, 55 insertions, 0 deletions
diff --git a/roles/fluentd_master/tasks/main.yml b/roles/fluentd_master/tasks/main.yml new file mode 100644 index 000000000..28caaa5b8 --- /dev/null +++ b/roles/fluentd_master/tasks/main.yml @@ -0,0 +1,46 @@ +--- +# TODO: Update fluentd install and configuration when packaging is complete +- name: download and install td-agent + yum: + name: 'http://packages.treasuredata.com/2/redhat/7/x86_64/td-agent-2.2.0-0.x86_64.rpm' + state: present + +- name: Verify fluentd plugin installed + command: '/opt/td-agent/embedded/bin/gem query -i fluent-plugin-kubernetes' + register: _fluent_plugin_check + ignore_errors: yes + +- name: install Kubernetes fluentd plugin + command: '/opt/td-agent/embedded/bin/gem install fluent-plugin-kubernetes' + when: _fluent_plugin_check.rc == 1 + +- name: Creates directories + file: + path: "{{ item }}" + state: directory + group: 'td-agent' + owner: 'td-agent' + mode: 0755 + with_items: ['/etc/td-agent/config.d'] + +- name: Add include to td-agent configuration + lineinfile: + dest: '/etc/td-agent/td-agent.conf' + regexp: '^@include config.d' + line: '@include config.d/*.conf' + state: present + +- name: install Kubernetes fluentd configuration file + template: + src: kubernetes.conf.j2 + dest: /etc/td-agent/config.d/kubernetes.conf + group: 'td-agent' + owner: 'td-agent' + mode: 0444 + +- name: ensure td-agent is running + service: + name: 'td-agent' + state: started + enabled: yes + diff --git a/roles/fluentd_master/templates/kubernetes.conf.j2 b/roles/fluentd_master/templates/kubernetes.conf.j2 new file mode 100644 index 000000000..7b5c86062 --- /dev/null +++ b/roles/fluentd_master/templates/kubernetes.conf.j2 @@ -0,0 +1,9 @@ +<match kubernetes.**> + type file + path /var/log/td-agent/containers.log + time_slice_format %Y%m%d + time_slice_wait 10m + time_format %Y%m%dT%H%M%S%z + compress gzip + utc +</match> |