salt/states/top.sls
2023-09-21 21:54:05 -05:00

41 lines
1 KiB
Text

{%- set states = salt['cp.list_states'](saltenv) -%}
{% for env in pillar['envs'] %}
{{ env }}:
'os_family:RedHat':
- match: grain_pcre
- repos.epel
'os_family:Arch':
- match: grain_pcre
- repos.arch
- systems.arch.mirrors
- systems.core.freeipa
'*':
{#- don't run update automatically on containers - updates will be triggered from their host -#}
{%- if pillar['roles'] is defined -%}
{%- if 'lxc_container' not in pillar['roles'] %}
- update
{%- endif -%}
{%- endif %}
- update.clean_cache
- update.update_containers
- basepkgs
- grains
- bashrc
- systems.core.firewalld
- systems.core.monitoring
- systems.core.mount
- systems.core.git
- systems.core.backup
- systems.core.time
{%- if pillar['roles'] is defined -%}
{%- if pillar['roles'] is not none -%}
{%- for role in pillar['roles'] %}
{%- if 'roles.maintain.'+role in states %}
- roles.maintain.{{role}}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endif -%}
{%- endfor %}
- systems.core.fstrim