6
6
{%- from tplroot ~ " /map.jinja" import prometheus as p with context % }
7
7
{%- from tplroot ~ " /jinja/macros.jinja" import format_kwargs with context % }
8
8
{%- from tplroot ~ " /libtofs.jinja" import files_switch with context % }
9
+ {%- set sls_users_install = tplroot ~ ' .config.users' % }
9
10
10
- prometheus- archive- install- file - directory:
11
+ include:
12
+ - {{ sls_users_install }}
13
+
14
+ prometheus- config- file - basedir- file - directory:
11
15
file .directory:
12
- - names:
13
- - {{ p.dir.basedir }}
14
- - {{ p.dir.etc }}
15
- - {{ p.dir.var }}
16
+ - name: {{ p.dir.basedir }}
16
17
- user: prometheus
17
18
- group: prometheus
18
19
- mode: 755
19
20
- makedirs: True
21
+ # require:
22
+ # sls: {{ sls_users_install }}
20
23
21
24
{%- for name in p.wanted % }
22
25
{%- set bundle = name + ' -%s .%s -%s ' | format (p.pkg[name][' archive_version' ], p.kernel, p.arch) % }
23
26
24
- prometheus- archive- install- {{ name }}- user- present:
25
- group.present:
26
- - name: {{ name }}
27
- - require_in:
28
- - user: prometheus- archive- install- {{ name }}- user- present
29
- user.present:
30
- - name: {{ name }}
31
- - shell: / bin / false
32
- - createhome: false
33
- - groups:
34
- - {{ name }}
35
- - require_in:
36
- - archive: prometheus- archive- install- {{ name }}- archive- extracted
37
-
38
27
prometheus- archive- install- {{ name }}- archive- extracted:
39
28
archive.extracted:
40
29
- name: {{ p.dir.basedir }}
@@ -47,6 +36,8 @@ prometheus-archive-install-{{ name }}-archive-extracted:
47
36
- recurse:
48
37
- user
49
38
- group
39
+ - require:
40
+ - file : prometheus- config- file - basedir- file - directory
50
41
51
42
{%- if name in p.service % }
52
43
@@ -59,6 +50,7 @@ prometheus-archive-install-{{ name }}-file-directory:
59
50
- makedirs: True
60
51
- require:
61
52
- archive: prometheus- archive- install- {{ name }}- archive- extracted
53
+ - file : prometheus- config- file - basedir- file - directory
62
54
63
55
prometheus- archive- install- {{ name }}- managed- service:
64
56
file .managed:
@@ -82,6 +74,7 @@ prometheus-archive-install-{{ name }}-managed-service:
82
74
stop: ' ' # not needed
83
75
- require:
84
76
- file : prometheus- archive- install- {{ name }}- file - directory
77
+ - file : prometheus- config- file - basedir- file - directory
85
78
86
79
{%- endif % }
87
80
{%- endfor % }
0 commit comments