forked from rossmcdonald/telegraf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-debian.yml
43 lines (38 loc) · 1.42 KB
/
install-debian.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
---
- name: Install any necessary dependencies [Debian/Ubuntu]
apt:
name: "{{ item }}"
state: present
update_cache: yes
cache_valid_time: 3600
with_items:
- python-httplib2
- python-apt
- curl
- apt-transport-https
- name: Import InfluxData GPG signing key [Debian/Ubuntu]
apt_key:
url: "{{ telegraf_influxdata_base_url }}/influxdb.key"
state: present
validate_certs: False
when: telegraf_install_url is not defined or telegraf_install_url == None
- name: Add InfluxData repository [Debian/Ubuntu]
apt_repository:
repo: deb {{ telegraf_influxdata_base_url }}/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} {{ telegraf_install_version }}
state: present
when: telegraf_install_url is not defined or telegraf_install_url == None
- name: Install Telegraf packages [Debian/Ubuntu]
apt:
name: telegraf
state: latest
update_cache: yes
cache_valid_time: 3600
when: telegraf_install_url is not defined or telegraf_install_url == None
- name: Download Telegraf package via URL [Debian/Ubuntu]
command: curl -o /tmp/telegraf-ansible-download.deb {{ telegraf_install_url }}
when: telegraf_install_url is defined and telegraf_install_url != None
- name: Install downloaded Telegraf package [Debian/Ubuntu]
apt:
deb: /tmp/telegraf-ansible-download.deb
state: present
when: telegraf_install_url is defined and telegraf_install_url != None