paulbsd-salt/states/old/sensu/agent/init.sls

78 lines
1.6 KiB
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
---
{%- from "sensu/map.jinja" import sensu with context %}
sensu-group:
group.present:
- name: sensu
- gid: 900
sensu-user:
user.present:
- name: sensu
- uid: 900
- gid: 900
- allow_uid_change: True
sensu-agent-bin:
file.managed:
- name: /usr/sbin/sensu-agent
- source: {{ sensu.fetch_url }}/sensu-agent-{{ salt['grains.get']('kernel')|lower }}-{{ salt['grains.get']('osarch')|lower }}
- skip_verify: True
- user: root
- group: root
- mode: 0755
- watch_in:
- service: sensu-agent-service
sensu-agent-service-file:
file.managed:
- name: /etc/systemd/system/sensu-agent.service
2020-08-16 23:42:57 +02:00
- source: salt://sensu/agent/sensu-agent.service.j2
2020-07-10 00:58:55 +02:00
- user: root
- group: root
2020-07-30 14:07:27 +02:00
- template: jinja
2020-07-10 00:58:55 +02:00
- mode: 0644
sensu-agent-cache-dir:
file.directory:
- name: /var/cache/sensu
- user: sensu
- group: sensu
- mode: 0750
- recurse:
- user
- group
- require:
- user: sensu-user
- group: sensu-group
sensu-agent-config-dir:
file.directory:
- name: /etc/sensu
- user: sensu
- group: sensu
- mode: 0750
- require:
- user: sensu-user
- group: sensu-group
sensu-agent-config-file:
file.managed:
- name: /etc/sensu/agent.yml
2020-08-16 23:42:57 +02:00
- source: salt://sensu/agent/agent.yml.j2
2020-07-10 00:58:55 +02:00
- user: sensu
- group: sensu
- mode: 0640
- template: jinja
- watch_in:
- service: sensu-agent-service
- require:
- file: sensu-agent-config-dir
- file: sensu-agent-cache-dir
sensu-agent-service:
service.running:
- name: sensu-agent
- enable: True
- require:
2020-07-30 14:07:27 +02:00
- file: sensu-agent-config-file