diff --git a/pillar.example b/pillar.example index dd408823..aef11ed0 100644 --- a/pillar.example +++ b/pillar.example @@ -10,9 +10,15 @@ salt: # This state will remove "/etc/salt/minion" when you set this to true. minion_remove_config: true + # /etc/salt/minion will be emptied if you set this to true. + minion_empty_config: true + # This state will remove "/etc/salt/master" when you set this to true. master_remove_config: true + # /etc/salt/master will be emptied if you set this to true. + master_empty_config: true + # Set this to 'py3' to install the Python 3 packages. # The default varies between OS versions. py_ver: 'py3' diff --git a/salt/defaults.yaml b/salt/defaults.yaml index 2b84eec3..ca607746 100644 --- a/salt/defaults.yaml +++ b/salt/defaults.yaml @@ -16,7 +16,9 @@ salt: config_path: /etc/salt minion_remove_config: false + minion_empty_config: false master_remove_config: false + master_empty_config: false minion_config_use_TOFS: false master_config_use_TOFS: false diff --git a/salt/master.sls b/salt/master.sls index af9d867d..c0075f86 100644 --- a/salt/master.sls +++ b/salt/master.sls @@ -72,6 +72,12 @@ remove-default-master-conf-file: - name: {{ salt_settings.config_path }}/master - watch_in: - service: salt-master + {% elif salt_settings.master_empty_config %} +empty-default-master-conf-file: + file.managed: + - name: {{ salt_settings.config_path }}/master + - contents: | + # Configuration is managed by Salt {% endif %} # clean up old _defaults.conf file if they have it around diff --git a/salt/minion.sls b/salt/minion.sls index 97db5b32..b944bf8d 100644 --- a/salt/minion.sls +++ b/salt/minion.sls @@ -181,6 +181,12 @@ salt-minion-beacon-inotify: remove-default-minion-conf-file: file.absent: - name: {{ salt_settings.config_path }}/minion + {% elif salt_settings.minion_empty_config %} +empty-default-minion-conf-file: + file.managed: + - name: {{ salt_settings.config_path }}/master + - contents: | + # Configuration is managed by Salt {% endif %} # clean up old _defaults.conf file if they have it around