-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-filebeat.sls
35 lines (31 loc) · 1.04 KB
/
install-filebeat.sls
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
{% from "default.yml" import lookup, rawmap with context %}
{% set lookup = salt['grains.filter_by'](lookup, grain='os', merge=salt['pillar.get']('filebeat:lookup')) %}
{% set rawmap = salt['pillar.get']('filebeat', rawmap) %}
{% if salt['grains.get']('os_family') == 'Debian' %}
apt_https_transport:
pkg.latest:
- name: apt-transport-https
{% endif %}
filebeat_repo:
pkgrepo.managed:
- humanname: Filebeat Repository
{% if salt['grains.get']('os') == 'CentOS' %}
- baseurl: {{lookup.repo_url}}
- gpgkey: {{lookup.gpg_url}}
{% else %}
- name: {{lookup.repo_url}}
- dist: stable
- key_url: {{lookup.gpg_url}}
{% endif %}
- file: {{lookup.repo_file}}
- gpgcheck: 1
- refresh_db: True
{% if salt['grains.get']('os_family') == 'Debian' %}
- require:
- pkg: apt_https_transport
{% endif %}
filebeat_package:
pkg.installed:
- name: {{lookup.package}}
- require:
- pkgrepo: filebeat_repo