From bee0ec0d2d976419b2709a86f7f56ce33089350c Mon Sep 17 00:00:00 2001 From: Loren Gordon Date: Fri, 31 Mar 2017 17:14:51 -0400 Subject: [PATCH 1/5] Aligns salt base env with new watchmaker-content project --- src/watchmaker/workers/salt.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/watchmaker/workers/salt.py b/src/watchmaker/workers/salt.py index 876c00288..ee9bbf355 100644 --- a/src/watchmaker/workers/salt.py +++ b/src/watchmaker/workers/salt.py @@ -100,7 +100,6 @@ def __init__(self, *args, **kwargs): # noqa: D102 self.salt_conf_path = None self.salt_conf = None self.salt_call = None - self.salt_file_root = None self.salt_base_env = None self.salt_formula_root = None self.salt_call_args = None @@ -108,12 +107,11 @@ def __init__(self, *args, **kwargs): # noqa: D102 @staticmethod def _get_salt_dirs(srv): - salt_file_root = os.sep.join((srv, 'states')) - salt_base_env = os.sep.join((salt_file_root, 'base')) + salt_base_env = os.sep.join((srv, 'states')) salt_formula_root = os.sep.join((srv, 'formulas')) salt_pillar_root = os.sep.join((srv, 'pillar')) return ( - salt_file_root, salt_base_env, salt_formula_root, salt_pillar_root + salt_base_env, salt_formula_root, salt_pillar_root ) def _prepare_for_install(self): @@ -139,7 +137,6 @@ def _prepare_for_install(self): ] for salt_dir in [ - self.salt_file_root, self.salt_base_env, self.salt_formula_root ]: @@ -356,10 +353,9 @@ def __init__(self, *args, **kwargs): # noqa: D102 self.salt_working_dir_prefix = 'salt-' salt_dirs = self._get_salt_dirs(self.salt_srv) - self.salt_file_root = salt_dirs[0] - self.salt_base_env = salt_dirs[1] - self.salt_formula_root = salt_dirs[2] - self.salt_pillar_root = salt_dirs[3] + self.salt_base_env = salt_dirs[0] + self.salt_formula_root = salt_dirs[1] + self.salt_pillar_root = salt_dirs[2] def _configuration_validation(self): if self.install_method.lower() == 'git': @@ -470,10 +466,9 @@ def __init__(self, *args, **kwargs): # noqa: D102 self.salt_working_dir_prefix = 'Salt-' salt_dirs = self._get_salt_dirs(self.salt_srv) - self.salt_file_root = salt_dirs[0] - self.salt_base_env = salt_dirs[1] - self.salt_formula_root = salt_dirs[2] - self.salt_pillar_root = salt_dirs[3] + self.salt_base_env = salt_dirs[0] + self.salt_formula_root = salt_dirs[1] + self.salt_pillar_root = salt_dirs[2] def _install_package(self): installer_name = os.sep.join( From e537e6514e4605b039f0efe94a72d57cf107f34e Mon Sep 17 00:00:00 2001 From: Loren Gordon Date: Fri, 31 Mar 2017 17:29:41 -0400 Subject: [PATCH 2/5] Extracts salt content to srv directory on Windows --- src/watchmaker/workers/salt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/watchmaker/workers/salt.py b/src/watchmaker/workers/salt.py index ee9bbf355..7de211307 100644 --- a/src/watchmaker/workers/salt.py +++ b/src/watchmaker/workers/salt.py @@ -516,7 +516,7 @@ def install(self): """Install salt and execute salt states.""" self._prepare_for_install() self._install_package() - self._build_salt_formula(self.salt_root) + self._build_salt_formula(self.salt_srv) if self.ash_role and self.ash_role != 'None': role = {'role': str(self.ash_role)} From 661a87cfedbbb18b939c470f96f9b81ef30cf783 Mon Sep 17 00:00:00 2001 From: Loren Gordon Date: Fri, 31 Mar 2017 17:37:52 -0400 Subject: [PATCH 3/5] Updates default config with url to new salt content --- src/watchmaker/static/config.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/watchmaker/static/config.yaml b/src/watchmaker/static/config.yaml index 9073c8797..d49b53fd4 100644 --- a/src/watchmaker/static/config.yaml +++ b/src/watchmaker/static/config.yaml @@ -2,6 +2,7 @@ all: - salt: admin_groups: None admin_users: None + content_source: https://s3.amazonaws.com/watchmaker/salt-content.zip computer_name: None environment: False formula_termination_strings: @@ -36,7 +37,6 @@ linux: url: https://s3.amazonaws.com/systemprep-repo/linux/saltstack/salt/yum.repos/salt-reposync-el7.repo - salt: salt_debug_log: None - content_source: https://s3.amazonaws.com/systemprep-content/linux/salt/salt-content.zip install_method: yum bootstrap_source: None git_repo: None @@ -45,5 +45,4 @@ linux: windows: - salt: salt_debug_log: None - content_source: https://s3.amazonaws.com/systemprep-content/windows/salt/salt-content.zip installer_url: https://s3.amazonaws.com/systemprep-repo/windows/salt/Salt-Minion-2016.11.2-AMD64-Setup.exe From 1814cbadb07fdeaa49bc3ff2e4d7468ab21a2295 Mon Sep 17 00:00:00 2001 From: Loren Gordon Date: Fri, 31 Mar 2017 17:52:53 -0400 Subject: [PATCH 4/5] Updates scap and pshelp submodules --- src/watchmaker/static/salt/formulas/pshelp-formula | 2 +- src/watchmaker/static/salt/formulas/scap-formula | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/watchmaker/static/salt/formulas/pshelp-formula b/src/watchmaker/static/salt/formulas/pshelp-formula index d6477b9e2..a558e85cb 160000 --- a/src/watchmaker/static/salt/formulas/pshelp-formula +++ b/src/watchmaker/static/salt/formulas/pshelp-formula @@ -1 +1 @@ -Subproject commit d6477b9e26ffa85c3878f72de345b32f0728658e +Subproject commit a558e85cb486abbd6543dcd2e14868ee6a9ac278 diff --git a/src/watchmaker/static/salt/formulas/scap-formula b/src/watchmaker/static/salt/formulas/scap-formula index 6245e766b..8643b44c2 160000 --- a/src/watchmaker/static/salt/formulas/scap-formula +++ b/src/watchmaker/static/salt/formulas/scap-formula @@ -1 +1 @@ -Subproject commit 6245e766b0bca5edb3c9059f98d7dd486a71810c +Subproject commit 8643b44c2f38565e3bbdb2b3262cbfd520ccea37 From e947bf3960e220519421e7e5ca2cd2051f4d5441 Mon Sep 17 00:00:00 2001 From: Loren Gordon Date: Sat, 1 Apr 2017 09:37:47 -0400 Subject: [PATCH 5/5] Removes submodules that are no longer used --- .gitmodules | 6 ------ src/watchmaker/static/salt/formulas/scc-formula | 1 - src/watchmaker/static/salt/formulas/systemprep-formula | 1 - 3 files changed, 8 deletions(-) delete mode 160000 src/watchmaker/static/salt/formulas/scc-formula delete mode 160000 src/watchmaker/static/salt/formulas/systemprep-formula diff --git a/.gitmodules b/.gitmodules index 39c393b43..924217b24 100644 --- a/.gitmodules +++ b/.gitmodules @@ -19,15 +19,9 @@ [submodule "src/watchmaker/static/salt/formulas/emet-formula"] path = src/watchmaker/static/salt/formulas/emet-formula url = https://github.com/plus3it/emet-formula.git -[submodule "src/watchmaker/static/salt/formulas/scc-formula"] - path = src/watchmaker/static/salt/formulas/scc-formula - url = https://github.com/plus3it/scc-formula.git [submodule "src/watchmaker/static/salt/formulas/windows-update-agent-formula"] path = src/watchmaker/static/salt/formulas/windows-update-agent-formula url = https://github.com/plus3it/windows-update-agent-formula.git -[submodule "src/watchmaker/static/salt/formulas/systemprep-formula"] - path = src/watchmaker/static/salt/formulas/systemprep-formula - url = https://github.com/plus3it/systemprep-formula.git [submodule "src/watchmaker/static/salt/formulas/netbanner-formula"] path = src/watchmaker/static/salt/formulas/netbanner-formula url = https://github.com/plus3it/netbanner-formula.git diff --git a/src/watchmaker/static/salt/formulas/scc-formula b/src/watchmaker/static/salt/formulas/scc-formula deleted file mode 160000 index 95a11e86b..000000000 --- a/src/watchmaker/static/salt/formulas/scc-formula +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 95a11e86b15dce71cfbda5025e8349787805372d diff --git a/src/watchmaker/static/salt/formulas/systemprep-formula b/src/watchmaker/static/salt/formulas/systemprep-formula deleted file mode 160000 index 6adb38944..000000000 --- a/src/watchmaker/static/salt/formulas/systemprep-formula +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6adb3894481452fa85c7206ac7c4c126814b7e4f