ansible/roles/telegraf/tasks/install-debian.yml

56 lines
1.6 KiB
YAML
Raw Normal View History

2021-01-10 19:11:32 +01:00
---
- name: Install any necessary dependencies [Debian/Ubuntu]
apt:
name:
- python-httplib2
- python-apt
- curl
- apt-transport-https
state: present
update_cache: yes
cache_valid_time: 3600
register: apt_result
until: apt_result is success
retries: 2
delay: 5
- name: Import InfluxData GPG signing key [Debian/Ubuntu]
apt_key:
url: "{{ telegraf_influxdata_base_url }}/influxdb.key"
state: present
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
register: apt_result
until: apt_result is success
retries: 2
delay: 5
when: telegraf_install_url is not defined or telegraf_install_url == None
- name: Download Telegraf package via URL [Debian/Ubuntu]
get_url:
url: "{{ telegraf_install_url }}"
dest: /tmp/telegraf-ansible-download.deb
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
register: apt_result
until: apt_result is success
retries: 2
delay: 5
when: telegraf_install_url is defined and telegraf_install_url != None