salt/pillars/roles/database/init.sls
2022-09-08 11:27:40 -05:00

14 lines
432 B
Text

{%- from "roles.jinja" import roles with context %}
{% set states = salt['cp.list_states'](saltenv) %}
include:
- roles.database.none
{%- if roles is not none -%}
{%- if 'mysql' in roles -%}
{%- for state in states %}
{%- if state.startswith("pillars.roles.database.") -%}
{%- set role = state.split('.')[3] %}
- roles.database.{{ role }}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endif -%}