[global] {%- for option in (smb_cfg | d({}) | dict2items) -%} {% if option.value is boolean -%} {{ option.key | replace('_', ' ') | lower }} = {{ 'yes' if option.value else 'no' }} {% elif (option.value | type_debug == 'list') -%} {{ option.key | replace('_', ' ') | lower }} = {{ option.value | join(', ') }} {% else -%} {{ option.key | replace('_', ' ') | lower }} = {{ option.value }} {% endif -%} {% endfor %} {% for share in smb_shares -%} [{{ share.name }}] path = {{ smb_storage_dir }}/{{ share.name }} {% if share.comment is defined -%} comment = {{ share.comment }} {%- endif %} {% endfor %}