5
5
{%- set tplroot = tpldir.split(' /' )[0 ] %}
6
6
{%- from tplroot ~ " /map.jinja" import prometheus with context % }
7
7
{%- from tplroot ~ " /map.jinja" import concat_args % }
8
- {%- set sls_config_install = tplroot ~ ' .config' % }
9
- {%- set sls_service_install = tplroot ~ ' .service' % }
8
+ {%- set sls_config_users = tplroot ~ ' .config.users' % }
9
+ {%- set sls_archive_install = tplroot ~ ' .archive' % }
10
+ {%- set sls_package_install = tplroot ~ ' .package' % }
10
11
11
12
include:
12
- - {{ sls_service_install }}
13
- - {{ sls_config_install }}
13
+ - {{ sls_archive_install if prometheus.use_upstream_archive else sls_package_install }}
14
+ - {{ sls_config_users }}
14
15
15
16
prometheus- config- file - args- file - directory:
16
17
file .directory:
@@ -19,8 +20,8 @@ prometheus-config-file-args-file-directory:
19
20
- group: prometheus
20
21
- mode: 755
21
22
- makedirs: True
22
- # require:
23
- # sls: {{ sls_config_install }}.users
23
+ - require:
24
+ - sls: ' {{ sls_archive_install if prometheus.use_upstream_archive else sls_package_install }} .* '
24
25
25
26
{%- for name in prometheus.wanted % }
26
27
{%- if name in prometheus.config or name in prometheus.service % }
@@ -51,6 +52,8 @@ prometheus-config-args-args-web-listen-address:
51
52
- value: {{ args.pop(' web.listen-address' ) }}
52
53
- watch_in:
53
54
- service: prometheus- service- running- {{ name }}- service- running
55
+ - require:
56
+ - file : prometheus- config- file - args- file - directory
54
57
55
58
{%- endif % }
56
59
{%- if ' collector.textfile.directory' in args.keys() % }
@@ -61,6 +64,8 @@ prometheus-config-args-{{ name }}-collector-textfile-directory:
61
64
- value: {{ args.pop(' collector.textfile.directory' ) }}
62
65
- watch_in:
63
66
- service: prometheus- service- running- {{ name }}- service- running
67
+ - require:
68
+ - file : prometheus- config- file - args- file - directory
64
69
65
70
{%- endif % }
66
71
{%- if ' storage.tsdb.path' in args.keys() % }
@@ -71,6 +76,8 @@ prometheus-config-args-{{ name }}-{{ key }}:
71
76
- value: {{ args.pop(' storage.tsdb.path' ) }}
72
77
- watch_in:
73
78
- service: prometheus- service- running- {{ name }}- service- running
79
+ - require:
80
+ - file : prometheus- config- file - args- file - directory
74
81
75
82
{%- endif % }
76
83
@@ -82,6 +89,8 @@ prometheus-config-args-{{ name }}-all:
82
89
- value: " {{ concat_args(args) }} >/dev/null 2>&1"
83
90
- watch_in:
84
91
- service: prometheus- service- running- {{ name }}- service- running
92
+ - require:
93
+ - file : prometheus- config- file - args- file - directory
85
94
86
95
{%- elif grains.os_family != ' FreeBSD' % }
87
96
@@ -92,6 +101,8 @@ prometheus-config-args-{{ name }}-file-managed:
92
101
ARGS = " {{ concat_args(args) }} "
93
102
- watch_in:
94
103
- service: prometheus- service- running- {{ name }}- service- running
104
+ - require:
105
+ - file : prometheus- config- file - args- file - directory
95
106
96
107
{%- endif % }
97
108
{%- endif % }
0 commit comments