feat(freebsd): support for FreeBSD
This commit is contained in:
parent
fabcc4ad77
commit
871da358a6
@ -13,6 +13,7 @@ include:
|
|||||||
- {{ sls_archive_install if prometheus.use_upstream_archive else sls_package_install }}
|
- {{ sls_archive_install if prometheus.use_upstream_archive else sls_package_install }}
|
||||||
- {{ sls_config_users }}
|
- {{ sls_config_users }}
|
||||||
|
|
||||||
|
{%- if prometheus.dir.args %}
|
||||||
prometheus-config-file-args-file-directory:
|
prometheus-config-file-args-file-directory:
|
||||||
file.directory:
|
file.directory:
|
||||||
- name: {{ prometheus.dir.args }}
|
- name: {{ prometheus.dir.args }}
|
||||||
@ -22,6 +23,7 @@ prometheus-config-file-args-file-directory:
|
|||||||
- makedirs: True
|
- makedirs: True
|
||||||
- require:
|
- require:
|
||||||
- sls: '{{ sls_archive_install if prometheus.use_upstream_archive else sls_package_install }}.*'
|
- sls: '{{ sls_archive_install if prometheus.use_upstream_archive else sls_package_install }}.*'
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
{%- for name in prometheus.wanted %}
|
{%- for name in prometheus.wanted %}
|
||||||
{%- if name in prometheus.config or name in prometheus.service %}
|
{%- if name in prometheus.config or name in prometheus.service %}
|
||||||
@ -39,23 +41,13 @@ prometheus-config-args-{{ name }}-data-dir:
|
|||||||
- makedirs: True
|
- makedirs: True
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- service: prometheus-service-running-{{ name }}-service-running
|
- service: prometheus-service-running-{{ name }}-service-running
|
||||||
|
{%- if prometheus.dir.args %}
|
||||||
- require:
|
- require:
|
||||||
- file: prometheus-config-file-args-file-directory
|
- file: prometheus-config-file-args-file-directory
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if args and grains.os_family == 'FreeBSD' %}
|
{%- if args and grains.os_family == 'FreeBSD' %}
|
||||||
{%- if 'web.listen-address' in args.keys() %}
|
|
||||||
|
|
||||||
prometheus-config-args-args-web-listen-address:
|
|
||||||
sysrc.managed:
|
|
||||||
- name: {{ name }}_listen_address
|
|
||||||
- value: {{ args.pop('web.listen-address') }}
|
|
||||||
- watch_in:
|
|
||||||
- service: prometheus-service-running-{{ name }}-service-running
|
|
||||||
- require:
|
|
||||||
- file: prometheus-config-file-args-file-directory
|
|
||||||
|
|
||||||
{%- endif %}
|
|
||||||
{%- if 'collector.textfile.directory' in args.keys() %}
|
{%- if 'collector.textfile.directory' in args.keys() %}
|
||||||
|
|
||||||
prometheus-config-args-{{ name }}-collector-textfile-directory:
|
prometheus-config-args-{{ name }}-collector-textfile-directory:
|
||||||
@ -64,22 +56,35 @@ prometheus-config-args-{{ name }}-collector-textfile-directory:
|
|||||||
- value: {{ args.pop('collector.textfile.directory') }}
|
- value: {{ args.pop('collector.textfile.directory') }}
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- service: prometheus-service-running-{{ name }}-service-running
|
- service: prometheus-service-running-{{ name }}-service-running
|
||||||
- require:
|
|
||||||
- file: prometheus-config-file-args-file-directory
|
|
||||||
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if 'storage.tsdb.path' in args.keys() %}
|
{%- if 'storage.tsdb.path' in args.keys() %}
|
||||||
|
|
||||||
prometheus-config-args-{{ name }}-{{ key }}:
|
prometheus-config-args-{{ name }}-storage-tsdb-path:
|
||||||
sysrc.managed:
|
sysrc.managed:
|
||||||
- name: {{ name }}_data_dir
|
- name: {{ name }}_data_dir
|
||||||
- value: {{ args.pop('storage.tsdb.path') }}
|
- value: {{ args.pop('storage.tsdb.path') }}
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- service: prometheus-service-running-{{ name }}-service-running
|
- service: prometheus-service-running-{{ name }}-service-running
|
||||||
- require:
|
|
||||||
- file: prometheus-config-file-args-file-directory
|
|
||||||
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- if name in ['node_exporter'] and 'web.listen-address' in args.keys() %}
|
||||||
|
|
||||||
|
prometheus-config-args-{{ name }}-web-listen-address:
|
||||||
|
sysrc.managed:
|
||||||
|
- name: {{ name }}_listen_address
|
||||||
|
- value: {{ args.pop('web.listen-address') }}
|
||||||
|
- watch_in:
|
||||||
|
- service: prometheus-service-running-{{ name }}-service-running
|
||||||
|
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
prometheus-config-args-{{ name }}-config-file:
|
||||||
|
sysrc.managed:
|
||||||
|
- name: {{ name }}_config
|
||||||
|
- value: {{ prometheus.dir.etc }}/{{ name }}.yml
|
||||||
|
- watch_in:
|
||||||
|
- service: prometheus-service-running-{{ name }}-service-running
|
||||||
|
|
||||||
prometheus-config-args-{{ name }}-all:
|
prometheus-config-args-{{ name }}-all:
|
||||||
sysrc.managed:
|
sysrc.managed:
|
||||||
@ -89,8 +94,6 @@ prometheus-config-args-{{ name }}-all:
|
|||||||
- value: "{{ concat_args(args) }} >/dev/null 2>&1"
|
- value: "{{ concat_args(args) }} >/dev/null 2>&1"
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- service: prometheus-service-running-{{ name }}-service-running
|
- service: prometheus-service-running-{{ name }}-service-running
|
||||||
- require:
|
|
||||||
- file: prometheus-config-file-args-file-directory
|
|
||||||
|
|
||||||
{%- elif grains.os_family != 'FreeBSD' %}
|
{%- elif grains.os_family != 'FreeBSD' %}
|
||||||
|
|
||||||
@ -109,8 +112,10 @@ prometheus-config-args-{{ name }}-file-managed:
|
|||||||
ARGS="{{ concat_args(args) }}"
|
ARGS="{{ concat_args(args) }}"
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- service: prometheus-service-running-{{ name }}-service-running
|
- service: prometheus-service-running-{{ name }}-service-running
|
||||||
|
{%- if prometheus.dir.args %}
|
||||||
- require:
|
- require:
|
||||||
- file: prometheus-config-file-args-file-directory
|
- file: prometheus-config-file-args-file-directory
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
@ -40,7 +40,8 @@ Alpine: {}
|
|||||||
FreeBSD:
|
FreeBSD:
|
||||||
rootgroup: wheel
|
rootgroup: wheel
|
||||||
dir:
|
dir:
|
||||||
config: /usr/local/etc
|
args: false
|
||||||
|
etc: /usr/local/etc/prometheus
|
||||||
pkg:
|
pkg:
|
||||||
prometheus:
|
prometheus:
|
||||||
archive_hash: 94a63f14baeadab2f17b5ae0bbeda6688e6d06f964ef4e32c2954a0ecf3996a1
|
archive_hash: 94a63f14baeadab2f17b5ae0bbeda6688e6d06f964ef4e32c2954a0ecf3996a1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user