Add upgrade task options

To ensure users can upgrade packages the variable
`"{{ elk_package_state | default('present') }}"` has been added
to all package installs.

Change-Id: I0238d9e1ed991cb1480bd924f2d5a09687890da3
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-06-14 11:50:48 -05:00
parent 77b08a54a7
commit 778002714c
6 changed files with 20 additions and 8 deletions

View File

@ -16,7 +16,7 @@
- name: add Elastic search public GPG key (same for Metricsbeat) - name: add Elastic search public GPG key (same for Metricsbeat)
apt_key: apt_key:
url: "https://artifacts.elastic.co/GPG-KEY-elasticsearch" url: "https://artifacts.elastic.co/GPG-KEY-elasticsearch"
state: "{{ elk_package_state | default('present') }}" state: "{{ ((elk_package_state | default('present')) == 'absent') | ternary('absent', 'present') }}"
- name: enable apt-transport-https - name: enable apt-transport-https
apt: apt:

View File

@ -68,7 +68,7 @@
- name: Ensure Java is installed - name: Ensure Java is installed
apt: apt:
name: openjdk-8-jre name: openjdk-8-jre
state: present state: "{{ elk_package_state | default('present') }}"
install_recommends: yes install_recommends: yes
update_cache: yes update_cache: yes
@ -77,7 +77,7 @@
- name: Ensure Elastic search is installed - name: Ensure Elastic search is installed
apt: apt:
name: elasticsearch name: elasticsearch
state: present state: "{{ elk_package_state | default('present') }}"
update_cache: yes update_cache: yes
- name: Drop elasticsearch conf file - name: Drop elasticsearch conf file

View File

@ -13,7 +13,7 @@
- name: Ensure Nginx is installed - name: Ensure Nginx is installed
apt: apt:
name: "{{ item }}" name: "{{ item }}"
state: present state: "{{ elk_package_state | default('present') }}"
update_cache: yes update_cache: yes
with_items: with_items:
- nginx - nginx
@ -42,7 +42,7 @@
- name: Ensure kibana is installed - name: Ensure kibana is installed
apt: apt:
name: kibana name: kibana
state: present state: "{{ elk_package_state | default('present') }}"
update_cache: yes update_cache: yes
- name: Drop kibana conf file - name: Drop kibana conf file

View File

@ -56,14 +56,14 @@
- name: Ensure Java is installed - name: Ensure Java is installed
apt: apt:
name: openjdk-8-jre name: openjdk-8-jre
state: present state: "{{ elk_package_state | default('present') }}"
install_recommends: yes install_recommends: yes
update_cache: yes update_cache: yes
- name: Ensure Logstash is installed - name: Ensure Logstash is installed
apt: apt:
name: logstash name: logstash
state: present state: "{{ elk_package_state | default('present') }}"
update_cache: yes update_cache: yes
- name: Drop Logstash conf for beats input - name: Drop Logstash conf for beats input

View File

@ -390,6 +390,18 @@ Example command using the embedded Ansible from within the grafana directory.
-e 'galera_address={{ internal_lb_vip_address }}' -e 'galera_address={{ internal_lb_vip_address }}'
Upgrading the cluster
---------------------
To upgrade the packages throughout the elastic search cluster set the package
state variable, `elk_package_state`, to latest.
.. code-block:: bash
cd /opt/openstack-ansible-ops/elk_metrics_6x
ansible-playbook site.yml $USER_VARS -e 'elk_package_state="latest"'
Trouble shooting Trouble shooting
---------------- ----------------

View File

@ -1,7 +1,7 @@
# elk apt repo # elk apt repo
elk_repo: elk_repo:
repo: 'deb https://artifacts.elastic.co/packages/6.x/apt stable main' repo: 'deb https://artifacts.elastic.co/packages/6.x/apt stable main'
state: "{{ elk_package_state | default('present') }}" state: "{{ ((elk_package_state | default('present')) == 'absent') | ternary('absent', 'present') }}"
#metricbeats monitoring endpoints #metricbeats monitoring endpoints
elastic_metricbeat_rabbitmq_monitoring_hosts: '"localhost:15672"' elastic_metricbeat_rabbitmq_monitoring_hosts: '"localhost:15672"'