Skip to content

Commit

Permalink
fix: revert to use of macro.jinja for arg handling
Browse files Browse the repository at this point in the history
The previous additions to environ.sh.jinja were fixing something that wasnt broken.
  • Loading branch information
BlueWolf committed Jun 30, 2021
1 parent e52f804 commit f2261f9
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
1 change: 1 addition & 0 deletions kitchen.yml
Expand Up @@ -9,6 +9,7 @@ driver:
run_command: /lib/systemd/systemd
forward:
- 9090:9090
- 9110:9110

platforms:
## SALT `tiamat`
Expand Down
2 changes: 1 addition & 1 deletion prometheus/config/environ.sls
Expand Up @@ -33,7 +33,7 @@ prometheus-config-install-{{ name }}-environ_file:
#- contents: |
# command_args="{{ concat_args(args) }}"
- context:
args: {{ args }}
args: {{ concat_args(args) }}
- watch_in:
- service: prometheus-service-running-{{ name }}
- require:
Expand Down
6 changes: 3 additions & 3 deletions prometheus/defaults.yaml
Expand Up @@ -44,7 +44,7 @@ prometheus:
version: v0.21.0
config_file: /etc/prometheus/alertmanager.yml
config: {}
environ_file: /etc/default/prometheus-alertmanager.sh
environ_file: /etc/default/prometheus-alertmanager
environ: {}
service:
args:
Expand Down Expand Up @@ -131,7 +131,7 @@ prometheus:
- tcp/9207
node_exporter:
version: v1.0.1
environ_file: /etc/default/prometheus-node-exporter.sh
environ_file: /etc/default/prometheus-node-exporter
environ: {}
config_file: /etc/prometheus/node_exporter.yml
config: {}
Expand Down Expand Up @@ -170,7 +170,7 @@ prometheus:
- tcp/9090
pushgateway:
version: v1.3.0
environ_file: /etc/default/prometheus-pushgateway.sh
environ_file: /etc/default/prometheus-pushgateway
environ: {}
config_file: /etc/prometheus/pushgateway.yml
config: {}
Expand Down
4 changes: 2 additions & 2 deletions prometheus/files/default/environ.sh.jinja
Expand Up @@ -2,8 +2,8 @@
# File managed by Salt at <{{ source }}>.
# Your changes may be overwritten.
########################################################################
# Set the command-line arguments to pass to the server.
ARGS="{%- for arg, value in args.items() %}--{{ arg }}={{ value }}{{ " " if not loop.last else "" }}{% endfor %}"
# Set the command-line arguments to pass to the server.%}"
ARGS="{{ args }}"



32 changes: 18 additions & 14 deletions test/salt/pillar/default.sls
Expand Up @@ -20,20 +20,20 @@ prometheus:
# - mysqld_exporter
# - memcached_exporter # not in upstream repo, only archive

exporters:
node_exporter:
textfile_collectors_dependencies: []
textfile_collectors:
ipmitool:
enable: false
remove: false
pkg: ipmitool
smartmon:
enable: false
remove: false
pkg: smartmontools
bash_pkg: bash
smartctl: /usr/sbin/smartctl
# exporters:
# node_exporter:
# textfile_collectors_dependencies: []
# textfile_collectors:
# ipmitool:
# enable: false
# remove: false
# pkg: ipmitool
# smartmon:
# enable: false
# remove: false
# pkg: smartmontools
# bash_pkg: bash
# smartctl: /usr/sbin/smartctl
pkg:
use_upstream_repo: false
# Changed to use non archive install as default (the archive includes a bespoke
Expand Down Expand Up @@ -87,6 +87,10 @@ prometheus:
- to: 'team-X+alerts@example.org'

node_exporter:
environ:
args:
collector.systemd: true
web.listen-address: ":9110"
service:
args:
collector.systemd: null
Expand Down

0 comments on commit f2261f9

Please sign in to comment.