From 6ae81a96407bab18e783ff1e18a0b22b325d315f Mon Sep 17 00:00:00 2001 From: Rene Jochum Date: Thu, 7 Jul 2016 16:16:50 +0200 Subject: [PATCH] Add support for mongodb connection settings to config templates. Signed-off-by: Rene Jochum --- salt/files/master.d/f_defaults.conf | 14 ++++++++++++++ salt/files/minion.d/f_defaults.conf | 16 +++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/salt/files/master.d/f_defaults.conf b/salt/files/master.d/f_defaults.conf index 08ca3eb..3965fa8 100644 --- a/salt/files/master.d/f_defaults.conf +++ b/salt/files/master.d/f_defaults.conf @@ -1379,4 +1379,18 @@ consul_config: {%- for name, value in cfg_master['consul_config'].items() %} {{ name }}: {{ value }} {%- endfor %} +{%- endif %} + +{% if 'mongo' in cfg_master -%} +##### mongodb connection settings ##### +########################################## +{%- for name, value in cfg_master['mongo'].items() %} +mongo.{{ name }}: {{ value }} +{%- endfor %} + +{% if 'alternative.mongo' in cfg_master -%} +{%- for name, value in cfg_master['alternative.mongo'].items() %} +alternative.mongo.{{ name }}: {{ value }} +{%- endfor %} +{% endif %} {%- endif %} \ No newline at end of file diff --git a/salt/files/minion.d/f_defaults.conf b/salt/files/minion.d/f_defaults.conf index 2d3ddfb..95d5865 100644 --- a/salt/files/minion.d/f_defaults.conf +++ b/salt/files/minion.d/f_defaults.conf @@ -990,4 +990,18 @@ ext_pillar: ############################################ # Default match type for filtering events tags: startswith, endswith, find, regex, fnmatch #event_match_type: startswith -{{ get_config('event_match_type', 'startswith') }} \ No newline at end of file +{{ get_config('event_match_type', 'startswith') }} + +{% if 'mongo' in cfg_minion -%} +##### mongodb connection settings ##### +########################################## +{%- for name, value in cfg_minion['mongo'].items() %} +mongo.{{ name }}: {{ value }} +{%- endfor %} + +{% if 'alternative.mongo' in cfg_minion -%} +{%- for name, value in cfg_minion['alternative.mongo'].items() %} +alternative.mongo.{{ name }}: {{ value }} +{%- endfor %} +{% endif %} +{%- endif %} \ No newline at end of file