Skip to content

Commit 130b807

Browse files
committed
feat: use tempalte instead of making 4 salt-calls!
1 parent 4351d0e commit 130b807

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

salt/base/auto-highstate.sls

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ curl:
55

66
/usr/local/bin/sentry-checkin.sh:
77
file.managed:
8-
- source: salt://base/scripts/sentry-checkin.sh
8+
- source: salt://base/scripts/sentry-checkin.sh.jinja
9+
- template: jinja
910
- mode: '0755'
1011
- user: root
1112
- group: root
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/bash
22

3-
MINION_ID=$(salt-call --local grains.get id --out=newline_values_only)
4-
SENTRY_INGEST_URL=$(salt-call pillar.get secrets:sentry:ingest_url --out=newline_values_only)
5-
SENTRY_PROJECT_ID=$(salt-call pillar.get secrets:sentry:project_id --out=newline_values_only)
6-
SENTRY_PROJECT_KEY=$(salt-call pillar.get secrets:sentry:project_key --out=newline_values_only)
3+
MINION_ID="{{ grains['id'] }}"
4+
SENTRY_INGEST_URL="{{ pillar.get('secrets:sentry:ingest_url', '') }}"
5+
SENTRY_PROJECT_ID="{{ pillar.get('secrets:sentry:project_id', '') }}"
6+
SENTRY_PROJECT_KEY="{{ pillar.get('secrets:sentry:project_key', '') }}"
77

88
MONITOR_SLUG="salt-highstate-${MINION_ID//./}"
99

0 commit comments

Comments
 (0)