ue_db: [
{%- for i, slave in enumerate(slap_configuration['sim_list']) %}
{%-   set s = json_module.loads(slave.pop('_')) %}
{%- if i == 0 -%}
{
{%- else -%}
, {
{%- endif %}
    sim_algo: "{{ s.get('sim_algo', 'milenage') }}",
    imsi: "{{ s.get('imsi', '') }}",
    opc: "{{ s.get('opc', '') }}",
    amf: {{ s.get('amf', '0x9001') }},
    sqn: "{{ s.get('sqn', '000000000000') }}",
    K: "{{ s.get('k', '') }}",
    impu: "{{ s.get('impu', '') }}",
    impi: "{{ s.get('impi', '') }}",
{%- if "ip" in s or s.get('enable_multicast', False) or s.get('enable_ipv6_multicast', False) or s.get('enable_broadcast') or s.get('route_list', False) %}
    pdn_list:[{
      access_point_name: "internet",
      default: true,
{%-   if "ip" in s %}
      ipv4_addr: "{{ s['ip'] }}"
{%-   endif %}
{%-   if s.get('enable_multicast', False) %}
      multicast: true,
{%-   endif %}
{%-   if s.get('enable_ipv6_multicast', False) %}
      ipv6_multicast: true,
{%-   endif %}
{%-   if s.get('enable_broadcast', False) %}
      broadcast: true,
{%-   endif %}
{%-   if s.get('route_list', False) %}
      routes: [
{%-     for _, route in s.route_list |dictsort %}
        [
          {
            ipv6_remote_addr_prefix: "{{ route['ipv6_remote_addr_prefix'] }}",
            prefix_len: {{ route['prefix_len'] }},
          }
        ],
{%-     endfor -%}
      ],
{%-   endif %}
    }]
{%- endif %}
}
{%- endfor -%}
]

