salt/states/top.sls

43 lines
1.2 KiB
Text
Raw Normal View History

2017-08-07 13:25:01 -05:00
{%- set states = salt['cp.list_states'](saltenv) -%}
{%- set envs=salt.cmd.shell('git ls-remote https://git.actcur.com/actcur/salt.git | grep -o -P "(?<=refs/heads/).*" | grep -Pv "(^temp$)|(^history$)"').split('\n') -%}
{%- set envs=salt.cmd.shell('ls /srv/salt/').split('\n') -%}
2017-08-07 13:25:01 -05:00
{% for env in envs %}
{{ env }}:
'os_family:RedHat':
2017-08-07 13:25:01 -05:00
- match: grain_pcre
- repos.epel
'os_family:Arch':
2017-08-07 13:25:01 -05:00
- match: grain_pcre
- repos.aur
- systems.arch.mirrors
- systems.core.freeipa
2017-08-07 13:25:01 -05:00
'*':
{#- 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'] %}
2017-08-07 13:25:01 -05:00
- update
{%- endif -%}
{%- endif %}
- update.clean_cache
- update.update_containers
2017-08-07 13:25:01 -05:00
- basepkgs
- grains
- bashrc
2017-08-07 13:25:01 -05:00
- systems.core.firewalld
- systems.core.monitoring
2017-08-07 13:25:01 -05:00
- systems.core.mount
- systems.core.git
- systems.core.backup
{%- if pillar['roles'] is defined -%}
{%- if pillar['roles'] is not none -%}
{%- for role in pillar['roles'] %}
2017-08-07 13:25:01 -05:00
{%- if 'roles.maintain.'+role in states %}
- roles.maintain.{{role}}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endif -%}
{%- endfor %}
2022-08-17 09:20:26 -05:00
- systems.core.fstrim