1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- ---
- - fail:
- msg: "fluentd master is not yet supported on atomic hosts"
- when: openshift.common.is_containerized | bool
- # TODO: Update fluentd install and configuration when packaging is complete
- - name: download and install td-agent
- action: "{{ ansible_pkg_mgr }} 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
- failed_when: false
- changed_when: false
- - 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: wait for etcd to start up
- wait_for: port=4001 delay=10
- when: embedded_etcd | bool
- - name: wait for etcd peer to start up
- wait_for: port=7001 delay=10
- when: embedded_etcd | bool
- - name: ensure td-agent is running
- service:
- name: 'td-agent'
- state: started
- enabled: yes
|