install.yml 1.34 KB
Newer Older
1
2
---
- name: Install any necessary dependencies [Debian/Ubuntu]
James Martin's avatar
James Martin committed
3
4
5
6
7
8
  apt: 
    name: "{{ item }}" 
    state: present 
    update_cache: yes 
    cache_valid_time: 3600

9
10
11
12
13
14
  with_items:
    - python-httplib2
    - python-apt
    - curl
  when: ansible_os_family == "Debian"
  
Ross McDonald's avatar
Ross McDonald committed
15
- name: Install any necessary dependencies [RedHat/CentOS]
James Martin's avatar
James Martin committed
16
17
18
  yum: 
    name: "{{ item }}" 
    state: present
19
20
21
22
23
  with_items:
    - curl
  when: ansible_os_family == "RedHat"    
    
- name: Import InfluxDB GPG signing key [Debian/Ubuntu]
James Martin's avatar
James Martin committed
24
25
26
  apt_key:
    url: https://repos.influxdata.com/influxdb.key
    state: present
27
28
29
  when: ansible_os_family == "Debian"

- name: Add InfluxDB repository [Debian/Ubuntu]
James Martin's avatar
James Martin committed
30
31
32
  apt_repository:
    repo: deb https://repos.influxdata.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} {{ install_version }}
    state: present
33
34
35
  when: ansible_os_family == "Debian"
    
- name: Add InfluxDB repository file [RHEL/CentOS]
James Martin's avatar
James Martin committed
36
37
38
39
40
  template:
    src: etc/yum.repos.d/influxdb.repo.j2
    dest: /etc/yum.repos.d/influxdb.repo
    force: yes
    backup: yes
41
42
43
  when: ansible_os_family == "RedHat"
  
- name: Install InfluxDB packages [Debian/Ubuntu]
James Martin's avatar
James Martin committed
44
45
46
  apt: 
    name: influxdb
    state: present
47
48
49
  when: ansible_os_family == "Debian"

- name: Install InfluxDB packages [RHEL/CentOS]
James Martin's avatar
James Martin committed
50
51
52
  yum: 
    name: influxdb
    state: present
53
  when: ansible_os_family == "RedHat"