paulbsd-salt/states/influxdb/templates/v2/init_v2.sls
Paul Lecuq a3b02771a4
All checks were successful
continuous-integration/drone/push Build is passing
created templates folder on each state
2023-03-11 10:08:26 +01:00

59 lines
1.6 KiB
Plaintext

---
influxdb-group:
group.present:
- name: influxdb
- gid: {{ salt['pillar.get']('influxdb:gid') }}
influxdb-user:
user.present:
- name: influxdb
- uid: {{ salt['pillar.get']('influxdb:uid') }}
- gid: {{ salt['pillar.get']('influxdb:gid') }}
- allow_uid_change: True
- allow_gid_change: True
- home: /var/lib/influxdb
influxdb-archive-extract:
archive.extracted:
- source: {{ salt['pillar.get']('influxdb:mirror') }}/influxdb-{{ salt['pillar.get']('influxdb:version') }}_{{ salt['grains.get']('kernel')|lower }}_{{ salt['grains.get']('osarch') }}.tar.gz
- skip_verify: True
- archive_format: tar
- user: influxdb
- group: influxdb
- name: /usr/local
- if_missing: /usr/local/influxdb-{{ salt['pillar.get']('influxdb:version') }}_{{ salt['grains.get']('kernel')|lower }}_{{ salt['grains.get']('osarch') }}
influxdb_directory:
file.directory:
- name: /var/lib/influxdb
- user: influxdb
- group: influxdb
- recurse:
- user
- group
influxdb-link:
file.symlink:
- name: /usr/local/influxdb
- user: influxdb
- group: influxdb
- target: /usr/local/influxdb_{{ salt['pillar.get']('influxdb:version') }}_{{ salt['grains.get']('kernel')|lower }}_{{ salt['grains.get']('osarch') }}
- force: True
influxdb-influx-link:
file.symlink:
- name: /usr/sbin/influx
- target: /usr/local/influxdb/influx
influxdb-service-file:
file.managed:
- name: /lib/systemd/system/influxdb.service
- source: salt://influxdb/influxdb.service.j2
- user: root
- group: root
influxdb-service:
service.running:
- name: influxdb
- enable: True