2
0

feat(tofs): allow TOFS for master configuration

This commit is contained in:
Imran Iqbal 2019-06-07 03:54:24 +01:00
parent 61a93d8c1e
commit 1b202afb29
No known key found for this signature in database
GPG Key ID: 6D8629439D2B7819
7 changed files with 32 additions and 2 deletions

View File

@ -64,9 +64,12 @@ salt:
# dirs:
# files: files_alt
# default: default_alt
# source_files: {}
# source_files:
# salt-master:
# - 'alt_master.d'
# salt master config
master_config_use_TOFS: True
master:
fileserver_backend:
- git

View File

@ -10,6 +10,7 @@ salt:
minion_remove_config: False
master_remove_config: False
master_config_use_TOFS: False
minion_service: salt-minion
master_service: salt-master

View File

@ -0,0 +1,4 @@
########################################################################
## File managed by Salt.
## Your changes will be overwritten.
########################################################################

View File

@ -0,0 +1,4 @@
########################################################################
## File managed by Salt.
## Your changes will be overwritten.
########################################################################

View File

@ -0,0 +1,4 @@
########################################################################
## File managed by Salt.
## Your changes will be overwritten.
########################################################################

View File

@ -0,0 +1,4 @@
########################################################################
## File managed by Salt.
## Your changes will be overwritten.
########################################################################

View File

@ -1,4 +1,6 @@
{% from "salt/map.jinja" import salt_settings with context %}
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import salt_settings with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
salt-master:
{% if salt_settings.install_packages %}
@ -14,8 +16,16 @@ salt-master:
{% endif %}
file.recurse:
- name: {{ salt_settings.config_path }}/master.d
{%- if salt_settings.master_config_use_TOFS %}
- template: ''
- source: {{ files_switch(['master.d'],
lookup='salt-master'
)
}}
{%- else %}
- template: jinja
- source: salt://{{ slspath }}/files/master.d
{%- endif %}
- clean: {{ salt_settings.clean_config_d_dir }}
- exclude_pat: _*
service.running: