{% set var = role.var | default({}) %} {% if var %} ## Default Variables {% set columns = ["variable", "default", "description", "type", "deprecated", "example"] %} {% set found_columns = ["variable", "default"] + var.values() | map("list") | sum(start=["key"]) | unique | list %} {% for c in columns %} {% if c in found_columns %} |{{ c | capitalize -}} {% endif %} {% endfor %} | {% for c in columns %} {% if c in found_columns %} |{{ "-" * (c | length) -}} {% endif %} {% endfor %} | {% for key, item in var | dictsort %} |{{ key -}} |{{ (item.value | default({}))[key] | default -}} {% if "description" in found_columns %} |{{ item.description | default([]) | safe_join("
") | replace("\n", "
") | replace("|", "\|") -}} {% endif %} {% if "type" in found_columns %} |{{ item.type | default([]) | join("
") -}} {% endif %} {% if "deprecated" in found_columns %} | {%- if "deprecated" in found_columns %} {% if item.deprecated is defined %} {% set deprecated = [item.deprecated] if item.deprecated is string else item.deprecated %} {% set deprecated_string = deprecated | map("replace", "\n", "
") | safe_join("
") %} {% if deprecated_string -%} {{ deprecated_string }} {%- else -%} True {%- endif %} {%- else -%} False {%- endif %} {% endif %} {% endif %} {% if "example" in found_columns %} |{{ item.example | default([]) | safe_join("
") | replace("\n", "
") | replace("|", "\|") -}} {% endif %} | {% endfor %} {% endif %}