Skip to content

Commit

Permalink
feat(tofs): allow TOFS for master configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Jun 7, 2019
1 parent 61a93d8 commit 1b202af
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions salt/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions salt/files/default/master.d/engine.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
########################################################################
## File managed by Salt.
## Your changes will be overwritten.
########################################################################
4 changes: 4 additions & 0 deletions salt/files/default/master.d/f_defaults.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
########################################################################
## File managed by Salt.
## Your changes will be overwritten.
########################################################################
4 changes: 4 additions & 0 deletions salt/files/default/master.d/lxc_profiles.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
########################################################################
## File managed by Salt.
## Your changes will be overwritten.
########################################################################
4 changes: 4 additions & 0 deletions salt/files/default/master.d/reactor.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
########################################################################
## File managed by Salt.
## Your changes will be overwritten.
########################################################################
12 changes: 11 additions & 1 deletion salt/master.sls
Original file line number Diff line number Diff line change
@@ -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 %}
Expand All @@ -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:
Expand Down

0 comments on commit 1b202af

Please sign in to comment.