{%- set filtered_slave_instance_list = [] %}
{%- for slave_instance in slave_instance_list %}
{%-   if slave_instance.get('imsi', '') != '' %}
{%-     do filtered_slave_instance_list.append(slave_instance) %}
{%-   endif %}
{%- endfor -%}
ue_db: [
{%- for i, slave_instance in enumerate(filtered_slave_instance_list) %}
{%- if i == 0 -%}
{
{%- else -%}
, {
{%- endif %}
    sim_algo: "{{ slave_instance.get('sim_algo', 'milenage') }}",
    imsi: "{{ slave_instance.get('imsi', '') }}",
    opc: "{{ slave_instance.get('opc', '') }}",
    amf: {{ slave_instance.get('amf', '0x9001') }},
    sqn: "{{ slave_instance.get('sqn', '000000000000') }}",
    K: "{{ slave_instance.get('k', '') }}",
    impu: "{{ slave_instance.get('impu', '') }}",
    impi: "{{ slave_instance.get('impi', '') }}",
}
{%- endfor -%}
]

