From f17b8f5424f271d8dbf9a19ad4b5887ab74ff081 Mon Sep 17 00:00:00 2001 From: Rene Jochum Date: Fri, 15 Jul 2016 15:13:21 +0200 Subject: [PATCH] Add optional method to remove /etc/salt/master. Signed-off-by: Rene Jochum --- pillar.example | 3 +++ salt/defaults.yaml | 1 + salt/master.sls | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/pillar.example b/pillar.example index 3033bef..0e7486c 100644 --- a/pillar.example +++ b/pillar.example @@ -7,6 +7,9 @@ salt: # This state will remove "/etc/salt/minion" when you set this to true. minion_remove_config: True + # This state will remove "/etc/salt/master" when you set this to true. + master_remove_config: True + # Set this to False to not have the formula install packages (in the case you # install Salt via git/pip/etc.) install_packages: True diff --git a/salt/defaults.yaml b/salt/defaults.yaml index 1cbb3f1..c20f387 100644 --- a/salt/defaults.yaml +++ b/salt/defaults.yaml @@ -7,6 +7,7 @@ salt: config_path: /etc/salt minion_remove_config: False + master_remove_config: False minion_service: salt-minion master_service: salt-master diff --git a/salt/master.sls b/salt/master.sls index 3352353..e7918e6 100644 --- a/salt/master.sls +++ b/salt/master.sls @@ -21,6 +21,12 @@ salt-master: - file: salt-master - file: remove-old-master-conf-file +{% if salt_settings.master_remove_config %} +remove-default-master-conf-file: + file.absent: + - name: {{ salt_settings.config_path }}/master +{% endif %} + # clean up old _defaults.conf file if they have it around remove-old-master-conf-file: file.absent: