-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathinit.sls
More file actions
76 lines (65 loc) · 1.96 KB
/
Copy pathinit.sls
File metadata and controls
76 lines (65 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#
# respondd
# Source for template: https://github.com/ffggrz/ext-respondd.git
#
/etc/systemd/system/respondd@.service:
file.managed:
- source: salt://respondd/respondd-tmpl/respondd@.service
python3-netifaces:
pkg.installed
python3-pyroute2:
pkg.installed
{% set sites = salt['pillar.get']('netbox:config_context:sites') %}
{% for prefix, domains in sites.items() %}
{% for site in domains %}
/opt/respondd-{{ site }}:
file.recurse:
- source: salt://respondd/respondd-tmpl
- exclude_pat:
- ".git/*"
- "lib/respondd_client.py"
- "*.example"
- watch_in:
- service: respondd@{{ site }}
/opt/respondd-{{ site }}/alias.json:
file.managed:
- source: salt://respondd/alias.json
- template: jinja
- defaults:
site: {{ site }}
prefix: {{ prefix }}
- watch_in:
- service: respondd@{{ site }}
/opt/respondd-{{ site }}/config.json:
file.managed:
- source: salt://respondd/config.json
- template: jinja
- defaults:
site: {{ site }}
- watch_in:
- service: respondd@{{ site }}
/opt/respondd-{{ site }}/lib/respondd_client.py:
file.managed:
- source: salt://respondd/respondd-tmpl/lib/respondd_client.py
- template: jinja
- defaults:
site: {{ site }}
- watch_in:
- service: respondd@{{ site }}
/opt/respondd-{{ site }}/ext-respondd.py:
file.managed:
- mode: "0755"
# only to harm the salt gods to not complain with
# "Neither 'source' nor 'contents' nor 'contents_pillar' nor 'contents_grains' was defined"
- source: salt://respondd/respondd-tmpl/ext-respondd.py
respondd@{{ site }}:
service.running:
- enable: True
- require:
- file: /opt/respondd-{{ site }}/alias.json
- file: /opt/respondd-{{ site }}/config.json
- file: /opt/respondd-{{ site }}/lib/respondd_client.py
- file: /opt/respondd-{{ site }}/ext-respondd.py
- file: /etc/systemd/system/respondd@.service
{% endfor %}
{% endfor %}