Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates salt config to align with new watchmaker-content project #235

Merged
merged 5 commits into from
Apr 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/watchmaker/static/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion src/watchmaker/static/salt/formulas/scap-formula
1 change: 0 additions & 1 deletion src/watchmaker/static/salt/formulas/scc-formula
Submodule scc-formula deleted from 95a11e
1 change: 0 additions & 1 deletion src/watchmaker/static/salt/formulas/systemprep-formula
Submodule systemprep-formula deleted from 6adb38
23 changes: 9 additions & 14 deletions src/watchmaker/workers/salt.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,18 @@ 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
self.salt_debug_logfile = None

@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):
Expand All @@ -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
]:
Expand Down Expand Up @@ -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':
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -521,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)}
Expand Down