diff --git a/ansible/README.rst b/ansible/README.rst index dda9de001..990cf6ac6 100644 --- a/ansible/README.rst +++ b/ansible/README.rst @@ -89,6 +89,11 @@ as needed. You can also change the logging backend to use fluentd via the ``logging_backend:`` variable. For most uses leaving the defaults in place is accceptable. If left unchanged the default is to use logstash. +You can also install the optional `curator `_ tool for managing +elasticsearch indexes. Set ``install_curator_tool: true`` to enable this optional tool installation. + +If all the variables look ok in ``install/group_vars/all.yml`` you can proceed with deployment. + :: ansible-playbook -i hosts install/elk.yml diff --git a/ansible/install/elk.yml b/ansible/install/elk.yml index 7028832fe..e9a270fe5 100644 --- a/ansible/install/elk.yml +++ b/ansible/install/elk.yml @@ -10,4 +10,5 @@ - { role: fluentd, when: (logging_backend == 'fluentd') } - { role: logstash, when: ((logging_backend is none) or (logging_backend == 'logstash')) } - { role: nginx } + - { role: curator, when: install_curator_tool } - { role: kibana } diff --git a/ansible/install/group_vars/all.yml b/ansible/install/group_vars/all.yml index 1b4e1c4f0..6b93ad0ff 100644 --- a/ansible/install/group_vars/all.yml +++ b/ansible/install/group_vars/all.yml @@ -157,3 +157,9 @@ logstash_syslog_port: 5044 fluentd_syslog_port: 42185 fluentd_http_port: 9919 fluentd_debug_port: 24230 +### install curator tool ### +# curator is the recommended tool for managing elasticsearch indexes +# https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html +# default is no (set to blank) or false +# set the below variable to 'true' to activate +install_curator_tool: false diff --git a/ansible/install/roles/curator/files/curator.repo b/ansible/install/roles/curator/files/curator.repo new file mode 100644 index 000000000..9a7a6ee1e --- /dev/null +++ b/ansible/install/roles/curator/files/curator.repo @@ -0,0 +1,6 @@ +[curator-3] +name=CentOS/RHEL 7 repository for Elasticsearch Curator 3.x packages +baseurl=http://packages.elastic.co/curator/3/centos/7 +gpgcheck=1 +gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch +enabled=1 diff --git a/ansible/install/roles/curator/tasks/main.yml b/ansible/install/roles/curator/tasks/main.yml new file mode 100644 index 000000000..659741756 --- /dev/null +++ b/ansible/install/roles/curator/tasks/main.yml @@ -0,0 +1,28 @@ + +--- +# +# install curator tool for managing elasticsearch +# + +- name: Copy curator yum repo file + copy: + src=curator.repo + dest=/etc/yum.repos.d/curator.repo + owner=root + group=root + mode=0644 + become: true + when: install_curator_tool + +- name: Import curator GPG Key + rpm_key: key=http://packages.elastic.co/GPG-KEY-elasticsearch + state=present + when: install_curator_tool + +- name: Install curator and python-setuptools + yum: name={{ item }} state=present + become: true + with_items: + - python-elasticsearch-curator + - python-setuptools + when: install_curator_tool