diff --git a/salt/common/tools/sbin/so-learn b/salt/common/tools/sbin/so-learn index 39004b052..e444bc442 100644 --- a/salt/common/tools/sbin/so-learn +++ b/salt/common/tools/sbin/so-learn @@ -32,9 +32,9 @@ salt_proc: subprocess.CompletedProcess = None # Temp store of modules, will likely be broken out into salt def get_learn_modules(): - return [ - { 'name': 'logscan', 'cpu_period': get_cpu_period(fraction=0.25), 'enabled': False, 'description': 'Scan log files against pre-trained models to alert on anomalies.' } - ] + return { + 'logscan': { 'cpu_period': get_cpu_period(fraction=0.25), 'enabled': False, 'description': 'Scan log files against pre-trained models to alert on anomalies.' } + } def get_cpu_period(fraction: float): diff --git a/salt/learn/init.sls b/salt/learn/init.sls index a511c1074..ee0b5e91b 100644 --- a/salt/learn/init.sls +++ b/salt/learn/init.sls @@ -1,12 +1,12 @@ {% from 'allowed_states.map.jinja' import allowed_states %} {% if sls in allowed_states %} -{% set module_list = salt['pillar.get']('learn:modules', [] ) %} +{% set module_dict = salt['pillar.get']('learn:modules', [] ) %} {% if module_list|length != 0 %}} include: -{% for module in module_list %} - - .{{ module }} +{% for module, _ in module_dict %} + - 'learn.{{ module }}' {% endfor %} {% endif %}