System modules are enables by default. But they should only be enables if in pillars defined and supported by os_family. Support for Redhat os_family systems is missing in at and cron #174pull/176/head
'logpath': '/var/log/atop', | 'logpath': '/var/log/atop', | ||||
'outfile': '/var/log/atop/daily.log' | 'outfile': '/var/log/atop/daily.log' | ||||
}, | }, | ||||
'at': { | |||||
'pkgs': [], | |||||
'services': [] | |||||
}, | |||||
'cron': { | |||||
'pkgs': [], | |||||
'services': [] | |||||
}, | |||||
}, | }, | ||||
'Debian': { | 'Debian': { | ||||
'pkgs': ['python-apt', 'apt-transport-https', 'libmnl0'], | 'pkgs': ['python-apt', 'apt-transport-https', 'libmnl0'], | ||||
'logpath': '/var/log/atop', | 'logpath': '/var/log/atop', | ||||
'outfile': '/var/log/atop/daily.log' | 'outfile': '/var/log/atop/daily.log' | ||||
}, | }, | ||||
'at': { | |||||
'pkgs': ['at'], | |||||
'services': ['atd'], | |||||
'user': {} | |||||
}, | |||||
'cron': { | |||||
'pkgs': ['cron'], | |||||
'services': ['cron'], | |||||
'user': {} | |||||
}, | |||||
}, | }, | ||||
'RedHat': { | 'RedHat': { | ||||
'pkgs': ['policycoreutils', 'policycoreutils-python', 'telnet', 'wget'], | 'pkgs': ['policycoreutils', 'policycoreutils-python', 'telnet', 'wget'], | ||||
'logpath': '/var/log/atop', | 'logpath': '/var/log/atop', | ||||
'outfile': '/var/log/atop/daily.log' | 'outfile': '/var/log/atop/daily.log' | ||||
}, | }, | ||||
'at': { | |||||
'pkgs': [], | |||||
'services': [] | |||||
}, | |||||
'cron': { | |||||
'pkgs': [], | |||||
'services': [] | |||||
}, | |||||
}, | }, | ||||
}, grain='os_family', merge=salt['pillar.get']('linux:system')) %} | }, grain='os_family', merge=salt['pillar.get']('linux:system')) %} | ||||
{% set at = salt['grains.filter_by']({ | |||||
'Debian': { | |||||
'enabled': false, | |||||
'pkgs': ['at'], | |||||
'services': ['atd'], | |||||
'user': {} | |||||
}, | |||||
}, grain='os_family', merge=salt['pillar.get']('linux:system:at')) %} | |||||
{% set cron = salt['grains.filter_by']({ | |||||
'Debian': { | |||||
'enabled': false, | |||||
'pkgs': ['cron'], | |||||
'services': ['cron'], | |||||
'user': {} | |||||
}, | |||||
}, grain='os_family', merge=salt['pillar.get']('linux:system:cron')) %} | |||||
{% set banner = salt['grains.filter_by']({ | {% set banner = salt['grains.filter_by']({ | ||||
'BaseDefaults': { | 'BaseDefaults': { | ||||
'enabled': false, | 'enabled': false, |
{%- from "linux/map.jinja" import system, at with context %} | |||||
{%- from "linux/map.jinja" import system with context %} | |||||
{%- if at.get('enabled', false) %} | |||||
{%- if system.at.enabled is defined and system.at.enabled %} | |||||
at_packages: | at_packages: | ||||
pkg.installed: | pkg.installed: | ||||
- names: {{ at.pkgs }} | |||||
- names: {{ system.at.pkgs }} | |||||
at_services: | at_services: | ||||
service.running: | service.running: | ||||
- enable: true | - enable: true | ||||
- names: {{ at.services }} | |||||
- names: {{ system.at.services }} | |||||
- require: | - require: | ||||
- pkg: at_packages | - pkg: at_packages | ||||
{%- if grains.get('noservices') %} | {%- if grains.get('noservices') %} | ||||
{%- endif %} | {%- endif %} | ||||
{%- set allow_users = [] %} | {%- set allow_users = [] %} | ||||
{%- for user_name, user_params in at.get('user', {}).items() %} | |||||
{%- for user_name, user_params in system.at.get('user', {}).items() %} | |||||
{%- set user_enabled = user_params.get('enabled', false) and | {%- set user_enabled = user_params.get('enabled', false) and | ||||
system.get('user', {}).get( | system.get('user', {}).get( | ||||
user_name, {'enabled': true}).get('enabled', true) %} | user_name, {'enabled': true}).get('enabled', true) %} |
{%- from "linux/map.jinja" import system, cron with context %} | |||||
{%- from "linux/map.jinja" import system with context %} | |||||
{%- if cron.get('enabled', false) %} | |||||
{%- if system.cron.enabled is defined and system.cron.enabled %} | |||||
cron_packages: | cron_packages: | ||||
pkg.installed: | pkg.installed: | ||||
- names: {{ cron.pkgs }} | |||||
- names: {{ system.cron.pkgs }} | |||||
cron_services: | cron_services: | ||||
service.running: | service.running: | ||||
- enable: true | - enable: true | ||||
- names: {{ cron.services }} | |||||
- names: {{ system.cron.services }} | |||||
- require: | - require: | ||||
- pkg: cron_packages | - pkg: cron_packages | ||||
{%- if grains.get('noservices') %} | {%- if grains.get('noservices') %} | ||||
{%- endif %} | {%- endif %} | ||||
{%- set allow_users = [] %} | {%- set allow_users = [] %} | ||||
{%- for user_name, user_params in cron.get('user', {}).items() %} | |||||
{%- for user_name, user_params in system.cron.get('user', {}).items() %} | |||||
{%- set user_enabled = user_params.get('enabled', false) and | {%- set user_enabled = user_params.get('enabled', false) and | ||||
system.get('user', {}).get( | system.get('user', {}).get( | ||||
user_name, {'enabled': true}).get('enabled', true) %} | user_name, {'enabled': true}).get('enabled', true) %} |
{%- if system.login_defs is defined %} | {%- if system.login_defs is defined %} | ||||
- linux.system.login_defs | - linux.system.login_defs | ||||
{%- endif %} | {%- endif %} | ||||
{%- if system.at is defined %} | |||||
- linux.system.at | - linux.system.at | ||||
{%- endif %} | |||||
{%- if system.cron is defined %} | |||||
- linux.system.cron | - linux.system.cron | ||||
{%- endif %} | |||||
{%- if system.repo|length > 0 %} | {%- if system.repo|length > 0 %} | ||||
- linux.system.repo | - linux.system.repo | ||||
{%- endif %} | {%- endif %} |