mirror of
https://github.com/luzifer-ansible/influxdb.git
synced 2024-11-08 13:50:11 +00:00
37 lines
840 B
YAML
37 lines
840 B
YAML
---
|
|
|
|
- name: Install apt key
|
|
apt_key:
|
|
url: https://repos.influxdata.com/influxdb.key
|
|
state: present
|
|
|
|
- name: Install apt-repo
|
|
apt_repository:
|
|
repo: 'deb https://repos.influxdata.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable'
|
|
state: present
|
|
|
|
- name: Install influxdb
|
|
apt:
|
|
name: influxdb
|
|
state: present
|
|
|
|
- name: Adjust configuration
|
|
replace:
|
|
dest: /etc/influxdb/influxdb.conf
|
|
regexp: '(# |){{ item.key }} = .*'
|
|
replace: '{{ item.key }} = {{ item.value }}'
|
|
with_dict: '{{ influxdb_config }}'
|
|
register: influxdb_config_replace
|
|
|
|
- name: Ensure influxdb is enabled
|
|
systemd:
|
|
name: influxdb.service
|
|
enabled: true
|
|
|
|
- name: Ensure influxdb is restarted
|
|
systemd:
|
|
name: influxdb.service
|
|
state: restarted
|
|
when: influxdb_config_replace.changed
|
|
|
|
...
|