From 73906a03a520c90920b1885add4d50865a6cb3fc Mon Sep 17 00:00:00 2001 From: Tobias Martin Date: Fri, 13 Jan 2017 14:22:39 +0100 Subject: [PATCH 1/2] added beacons configuration support --- pillar.example | 16 +++++++++++++++- salt/files/minion.d/beacons.conf | 9 +++++++++ salt/files/minion.d/f_defaults.conf | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 salt/files/minion.d/beacons.conf diff --git a/pillar.example b/pillar.example index 3394677..721bd3b 100644 --- a/pillar.example +++ b/pillar.example @@ -141,7 +141,7 @@ salt: auth_keytab: /root/auth.keytab auth_principal: kadmin/admin - # optional engine configuration + # optional engine configuration engines: slack: token: xoxp-XXXXX-XXXXXXX @@ -157,6 +157,20 @@ salt: type: runner cmd: jobs.list_jobs + # optional beacons configuration + beacons: + load: + 1m: + - 0.0 + - 2.0 + 5m: + - 0.0 + - 1.5 + 15m: + - 0.1 + - 1.0 + interval: 10 + # salt cloud config cloud: diff --git a/salt/files/minion.d/beacons.conf b/salt/files/minion.d/beacons.conf new file mode 100644 index 0000000..72c7105 --- /dev/null +++ b/salt/files/minion.d/beacons.conf @@ -0,0 +1,9 @@ +# +# This file is managed by Salt! Do not edit by hand! +# +{%- set beacons = salt['pillar.get']('salt:beacons') -%} +{%- set engines = salt['pillar.get']('salt:minion:beacons', default=engines, merge=True) -%} +{%- if beacons %} +beacons: + {{ beacons | yaml(False) | indent(2) }} +{%- endif -%} diff --git a/salt/files/minion.d/f_defaults.conf b/salt/files/minion.d/f_defaults.conf index c6629f0..d4110c8 100644 --- a/salt/files/minion.d/f_defaults.conf +++ b/salt/files/minion.d/f_defaults.conf @@ -1,7 +1,7 @@ # This file managed by Salt, do not edit by hand!! # Based on salt version 2015.8.7 default config # -{% set reserved_keys = ['master', 'minion', 'cloud', 'salt_cloud_certs', 'engines'] -%} +{% set reserved_keys = ['master', 'minion', 'cloud', 'salt_cloud_certs', 'engines', 'beacons'] -%} {% set cfg_salt = pillar.get('salt', {}) -%} {% set cfg_minion = cfg_salt.get('minion', {}) -%} {% set default_keys = [] -%} From fc408475420ea2a540b158a9afe41ab31f063573 Mon Sep 17 00:00:00 2001 From: Tobias Martin Date: Fri, 13 Jan 2017 15:26:17 +0100 Subject: [PATCH 2/2] fixed beacon variable name --- salt/files/minion.d/beacons.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/files/minion.d/beacons.conf b/salt/files/minion.d/beacons.conf index 72c7105..e9bb4f8 100644 --- a/salt/files/minion.d/beacons.conf +++ b/salt/files/minion.d/beacons.conf @@ -2,7 +2,7 @@ # This file is managed by Salt! Do not edit by hand! # {%- set beacons = salt['pillar.get']('salt:beacons') -%} -{%- set engines = salt['pillar.get']('salt:minion:beacons', default=engines, merge=True) -%} +{%- set beacons = salt['pillar.get']('salt:minion:beacons', default=beacons, merge=True) -%} {%- if beacons %} beacons: {{ beacons | yaml(False) | indent(2) }}