add role service-influxdb
This commit is contained in:
parent
0153384d76
commit
c65d39ee54
3 changed files with 53 additions and 0 deletions
|
@ -9,6 +9,7 @@ packages:
|
||||||
- mlocate
|
- mlocate
|
||||||
- mosh
|
- mosh
|
||||||
- net-tools
|
- net-tools
|
||||||
|
- python-pip
|
||||||
- python3-yaml
|
- python3-yaml
|
||||||
- sysfsutils
|
- sysfsutils
|
||||||
- unattended-upgrades
|
- unattended-upgrades
|
||||||
|
|
5
roles/service-influxdb/handlers/main.yml
Normal file
5
roles/service-influxdb/handlers/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
- name: restart influxdb
|
||||||
|
systemd:
|
||||||
|
name: influxdb
|
||||||
|
state: restarted
|
47
roles/service-influxdb/tasks/main.yml
Normal file
47
roles/service-influxdb/tasks/main.yml
Normal 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
|
Loading…
Reference in a new issue