install-debian.yml 1.46 KB
Newer Older
1
---
2
3
4
5
6
7
8
9
10
11
12
- 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

13
- name: Import InfluxData GPG signing key [Debian/Ubuntu]
14
15
16
  apt_key:
    url: https://repos.influxdata.com/influxdb.key
    state: present
17
  when: influxdb_install_url is not defined or influxdb_install_url == None
18

19
- name: Add InfluxData repository [Debian/Ubuntu]
20
  apt_repository:
21
    repo: deb https://repos.influxdata.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} {{ influxdb_install_version }}
22
    state: present
23
  when: influxdb_install_url is not defined or influxdb_install_url == None
24
25
26
27

- name: Install InfluxDB packages [Debian/Ubuntu]
  apt: 
    name: influxdb
28
    state: latest
29
30
  when: influxdb_install_url is not defined or influxdb_install_url == None
  
31
32
33
34
35
36
37
- name: Download InfluxDB package via URL [Debian/Ubuntu]
  command: curl -o /tmp/influxdb-ansible-download.deb {{ influxdb_install_url }}
  when: influxdb_install_url is defined and influxdb_install_url != None

- name: Install downloaded InfluxDB package [Debian/Ubuntu]
  apt:
    deb: /tmp/influxdb-ansible-download.deb
38
39
    state: present
  when: influxdb_install_url is defined and influxdb_install_url != None
40
41
42
43
44
45
46

- name: Capture installed InfluxDB version
  command: dpkg -l influxdb
  register: reg_influxdb_version

- debug: var=reg_influxdb_version.stdout_lines