Zack Williams | e0dedec | 2017-02-19 23:22:32 -0700 | [diff] [blame^] | 1 | --- |
| 2 | # install_elk/tasks/main.yml |
Sapan Bhatia | 01ddea6 | 2017-02-10 11:28:48 -0800 | [diff] [blame] | 3 | |
| 4 | - name: Add ELK repositories |
| 5 | apt_repository: repo={{ item }} state="present" |
| 6 | with_items: |
Zack Williams | e0dedec | 2017-02-19 23:22:32 -0700 | [diff] [blame^] | 7 | - deb http://packages.elastic.co/elasticsearch/2.x/debian stable main |
| 8 | - deb http://packages.elastic.co/kibana/4.4/debian stable main |
| 9 | - deb http://packages.elastic.co/logstash/2.2/debian stable main |
Sapan Bhatia | 01ddea6 | 2017-02-10 11:28:48 -0800 | [diff] [blame] | 10 | |
| 11 | - name: Install ELK |
| 12 | apt: name={{ item }} state=installed update_cache=yes force=yes |
| 13 | with_items: |
Zack Williams | e0dedec | 2017-02-19 23:22:32 -0700 | [diff] [blame^] | 14 | - elasticsearch |
| 15 | - kibana |
| 16 | - logstash |
Sapan Bhatia | 01ddea6 | 2017-02-10 11:28:48 -0800 | [diff] [blame] | 17 | |
| 18 | - name: Configure Logstash |
| 19 | copy: src={{ item }} dest=/etc/logstash/conf.d/{{ item }} owner=root group=root mode=0644 |
| 20 | with_items: |
Zack Williams | e0dedec | 2017-02-19 23:22:32 -0700 | [diff] [blame^] | 21 | - 10-udp-input.conf |
| 22 | - 11-log4j-input.conf |
| 23 | - 12-syslog-input.conf |
| 24 | - 30-elasticsearch-output.conf |
Sapan Bhatia | 01ddea6 | 2017-02-10 11:28:48 -0800 | [diff] [blame] | 25 | |
| 26 | - name: Start ELK |
| 27 | service: name={{ item }} state=started enabled=yes |
| 28 | with_items: |
Zack Williams | e0dedec | 2017-02-19 23:22:32 -0700 | [diff] [blame^] | 29 | - logstash |
| 30 | - elasticsearch |
| 31 | - kibana |
Sapan Bhatia | 01ddea6 | 2017-02-10 11:28:48 -0800 | [diff] [blame] | 32 | |