Initial commit
This commit is contained in:
commit
9c2d5ab324
5 changed files with 50 additions and 0 deletions
43
tasks/main.yml
Normal file
43
tasks/main.yml
Normal file
|
@ -0,0 +1,43 @@
|
|||
---
|
||||
- name: Set OS dependent variables
|
||||
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
|
||||
vars:
|
||||
params:
|
||||
files:
|
||||
- "{{ ansible_distribution | lower }}_{{ ansible_distribution_version | lower }}.yml"
|
||||
- "{{ ansible_distribution | lower }}_{{ ansible_distribution_major_version | lower }}.yml"
|
||||
- "{{ ansible_distribution | lower }}.yml"
|
||||
- "{{ ansible_os_family | lower }}.yml"
|
||||
- "{{ ansible_system | lower }}.yml"
|
||||
paths:
|
||||
- '{{ role_path }}/vars'
|
||||
ignore_errors: True
|
||||
|
||||
- name: OS is supported
|
||||
ansible.builtin.assert:
|
||||
that: __os_supported
|
||||
quiet: True
|
||||
vars:
|
||||
__os_supported: "{{ lookup('vars', '{}_os_supported'.format(role_name)) | bool }}"
|
||||
|
||||
- name: Add elasticsearch GPG key
|
||||
shell:
|
||||
cmd: "wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add - "
|
||||
|
||||
- name: Install apt-transport-https
|
||||
apt:
|
||||
pkg:
|
||||
- apt-transport-https
|
||||
state: latest
|
||||
update_cache: yes
|
||||
|
||||
- name: Add elasticsearch repo to sources
|
||||
shell:
|
||||
cmd: "echo \"deb https://artifacts.elastic.co/packages/6.x/apt stable main\" | tee -a /etc/apt/sources.list.d/elastic-6.x.list"
|
||||
|
||||
- name: Install elasticsearch
|
||||
apt:
|
||||
pkg:
|
||||
- elasticsearch=6.1.0
|
||||
state: latest
|
||||
update_cache: yes
|
Loading…
Add table
Add a link
Reference in a new issue