-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpre-download.yml
70 lines (57 loc) · 1.97 KB
/
pre-download.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
- hosts: logstash
gather_facts: no
tasks:
- name: Validate logstash Version
fail: msg="Invalid ELK Version"
when: elk_version is undefined or not elk_version is match("\d+\.\d+\.\d+")
- name: Get logstash current version
command: rpm -q logstash --qf %{VERSION}
args:
warn: no
changed_when: False
register: version_found
- name: Pre-download logstash install package
yum:
name: logstash-{{ elk_version }}
download_only: yes
when: version_found.stdout is version_compare(elk_version, '<')
- hosts: elasticsearch
gather_facts: no
# vars:
# s3_plugin_url: https://artifacts.elastic.co/downloads/elasticsearch-plugins/repository-s3/repository-s3-{{ elk_version }}.zip
tasks:
- name: Validate elasticsearch Version
fail: msg="Invalid ELK Version"
when: elk_version is undefined or not elk_version is match("\d+\.\d+\.\d+")
- name: Get elasticsearch current version
command: rpm -q elasticsearch --qf %{VERSION}
args:
warn: no
changed_when: False
register: version_found
- name: Pre-download elasticsearch install package
yum:
name: elasticsearch-{{ elk_version }}
download_only: yes
when: version_found.stdout is version_compare(elk_version, '<')
# - name: Download repository-s3 plugin
# get_url: url={{ s3_plugin_url }} dest=/tmp/repository-s3-{{ elk_version }}.zip
# when: version_found.stdout is version_compare(elk_version, '<')
- hosts: kibana
gather_facts: no
tasks:
- name: Validate kibana Version
fail: msg="Invalid ELK Version"
when: elk_version is undefined or not elk_version is match("\d+\.\d+\.\d+")
- name: Get kibana current version
command: rpm -q kibana --qf %{VERSION}
args:
warn: no
changed_when: False
register: version_found
- name: Pre-download kibana install package
yum:
name: kibana-{{ elk_version }}
download_only: yes
when: version_found.stdout is version_compare(elk_version, '<')