2019-04-18 13:49:30 -07:00
|
|
|
|
|
|
|
- name: Install Kibana
|
|
|
|
hosts: elastic
|
|
|
|
|
|
|
|
tasks:
|
2019-04-19 12:52:07 -07:00
|
|
|
- name: Install Elastic GPG Key
|
|
|
|
become: true
|
|
|
|
apt_key:
|
|
|
|
url: "https://artifacts.elastic.co/GPG-KEY-elasticsearch"
|
|
|
|
state: present
|
|
|
|
id: 46095ACC8548582C1A2699A9D27D666CD88E42B4
|
|
|
|
|
|
|
|
- name: Install apt-transport-https
|
|
|
|
apt:
|
|
|
|
name: apt-transport-https
|
|
|
|
|
|
|
|
- name: Add Elastic Repo
|
|
|
|
become: true
|
|
|
|
copy:
|
|
|
|
src: elastic-7.x.list
|
|
|
|
dest: /etc/apt/sources.list.d/
|
|
|
|
backup: yes
|
|
|
|
|
|
|
|
- name: Update Packages
|
|
|
|
become: true
|
|
|
|
apt:
|
|
|
|
update_cache: true
|
|
|
|
|
|
|
|
- name: Install kibana
|
|
|
|
become: true
|
|
|
|
apt:
|
|
|
|
name: kibana
|
2019-04-18 14:21:20 -07:00
|
|
|
|
2019-04-19 12:52:07 -07:00
|
|
|
|
|
|
|
- name: Config - Server.Port 5601
|
|
|
|
become: true
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/kibana/kibana.yml
|
|
|
|
regex: '^server.port'
|
|
|
|
insertafter: '#server.port: 5601'
|
|
|
|
line: 'server.port: 5601'
|
|
|
|
backup: yes
|
|
|
|
|
|
|
|
|
|
|
|
- name: Config - Server.host
|
|
|
|
become: true
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/kibana/kibana.yml
|
|
|
|
regex: '^server.host'
|
|
|
|
insertafter: '#server.host'
|
|
|
|
line: 'server.host: {{ ansible_eno1.ipv4.address }}'
|
|
|
|
|
|
|
|
- name: Config - elasticsearch.hosts
|
|
|
|
become: true
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/kibana/kibana.yml
|
|
|
|
regex: '^elasticsearch.hosts'
|
|
|
|
insertafter: '#elasticsearch.hosts:'
|
|
|
|
line: 'elasticsearch.hosts: ["http://localhost:9200"]'
|
|
|
|
|
|
|
|
- name: Allow port 5601
|
|
|
|
become: true
|
|
|
|
ufw:
|
|
|
|
rule: allow
|
|
|
|
port: 5601
|
|
|
|
|
|
|
|
- name: systemd - daemon reload
|
|
|
|
become: true
|
|
|
|
systemd:
|
|
|
|
daemon_reload: yes
|
|
|
|
|
|
|
|
- name: systemd - enable Kibana on startup
|
|
|
|
become: true
|
|
|
|
systemd:
|
|
|
|
name: kibana
|
|
|
|
enabled: yes
|
|
|
|
|
|
|
|
- name: systemd - restart Kibana
|
|
|
|
become: true
|
|
|
|
systemd:
|
|
|
|
name: kibana
|
|
|
|
state: restarted
|
2019-04-18 13:49:30 -07:00
|
|
|
|