add role service-influxdb

This commit is contained in:
Julian Labus 2018-09-11 14:16:48 +02:00
parent 0153384d76
commit c65d39ee54
No known key found for this signature in database
GPG key ID: 8AF209F2C6B3572A
3 changed files with 53 additions and 0 deletions

View file

@ -9,6 +9,7 @@ packages:
- mlocate
- mosh
- net-tools
- python-pip
- python3-yaml
- sysfsutils
- unattended-upgrades

View file

@ -0,0 +1,5 @@
---
- name: restart influxdb
systemd:
name: influxdb
state: restarted

View file

@ -0,0 +1,47 @@
---
- name: ensure apt key for influxdb is present
apt_key:
state: present
id: 2582E0C5
url: "https://repos.influxdata.com/influxdb.key"
- name: ensure influxdb apt repo is present
apt_repository:
state: present
repo: "deb https://repos.influxdata.com/debian stretch stable"
update_cache: yes
filename: influxdb
- name: install influxdb package
package:
name: influxdb
state: present
- name: bind influxdb to localhost only
lineinfile:
dest: "/etc/influxdb/influxdb.conf"
regexp: '^.*bind-address.*:8086.*$'
line: ' bind-address = "127.0.0.1:8086"'
notify: restart influxdb
- name: enable influxdb rpc on localhost only
lineinfile:
dest: "/etc/influxdb/influxdb.conf"
regexp: '^.*bind-address.*:8088.*$'
line: 'bind-address = "127.0.0.1:8088"'
notify: restart influxdb
- name: install python-requests package
package:
name: python-requests
state: present
- name: install python-influxdb package
pip:
name: influxdb
- name: enable systemd unit influxdb
systemd:
name: influxdb
enabled: yes
state: started