apiVersion: v1
data:
  network_config_template: |
    ---
    {% set mtu_list = [ctlplane_mtu] %}
    {% for network in nodeset_networks %}
    {% set _ = mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) %}
    {%- endfor %}
    {% set min_viable_mtu = mtu_list | max %}
    network_config:
    - type: ovs_bridge
      name: {{ neutron_physical_bridge_name }}
      mtu: {{ min_viable_mtu }}
      use_dhcp: false
      dns_servers: {{ ctlplane_dns_nameservers }}
      domain: {{ dns_search_domains }}
      addresses:
      - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }}
      routes: {{ ctlplane_host_routes }}
      members:
      - type: interface
        name: nic1
        mtu: {{ min_viable_mtu }}
        # force the MAC address of the bridge to this interface
        primary: true
    {% for network in nodeset_networks %}
      - type: vlan
        mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }}
        vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }}
        addresses:
        - ip_netmask:
            {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }}
        routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }}
    {% endfor %}
kind: ConfigMap
metadata:
  labels:
    created-by: install_yamls
  name: network-config-template-ipam
  namespace: openstack
---
apiVersion: v1
data:
  physical_bridge_name: br-ex
  public_interface_name: eth0
kind: ConfigMap
metadata:
  labels:
    created-by: install_yamls
  name: neutron-edpm-ipam
  namespace: openstack
---
apiVersion: v1
data:
  25-nova-extra.conf: ""
kind: ConfigMap
metadata:
  labels:
    created-by: install_yamls
  name: nova-extra-config
  namespace: openstack
---
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneDeployment
metadata:
  labels:
    created-by: install_yamls
  name: edpm-deployment
  namespace: openstack
spec:
  nodeSets:
  - openstack-edpm-ipam
---
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneNodeSet
metadata:
  labels:
    created-by: install_yamls
  name: openstack-edpm-ipam
  namespace: openstack
spec:
  env:
  - name: ANSIBLE_VERBOSITY
    value: "2"
  networkAttachments:
  - ctlplane
  nodeTemplate:
    ansible:
      ansibleUser: zuul
      ansibleVars:
        ctlplane_dns_nameservers:
        - 192.168.122.10
        - 199.204.44.24
        edpm_container_registry_insecure_registries:
        - 38.102.83.107:5001
        edpm_network_config_debug: true
        edpm_network_config_template: |-
          ---
          {% set mtu_list = [ctlplane_mtu] %}
          {% for network in nodeset_networks %}
          {% set _ = mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) %}
          {%- endfor %}
          {% set min_viable_mtu = mtu_list | max %}
          network_config:
          - type: interface
            name: nic1
            use_dhcp: true
            mtu: {{ min_viable_mtu }}
          - type: ovs_bridge
            name: {{ neutron_physical_bridge_name }}
            mtu: {{ min_viable_mtu }}
            use_dhcp: false
            dns_servers: {{ ctlplane_dns_nameservers }}
            domain: {{ dns_search_domains }}
            addresses:
            - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }}
            routes: {{ ctlplane_host_routes }}
            members:
            - type: interface
              name: nic2
              mtu: {{ min_viable_mtu }}
              # force the MAC address of the bridge to this interface
              primary: true
          {% if edpm_network_config_nmstate | bool %}
              # this ovs_extra configuration fixes OSPRH-17551, but it will be not needed when FDP-1472 is resolved
              ovs_extra:
                - "set interface eth1 external-ids:ovn-egress-iface=true"
          {% endif %}
          {% for network in nodeset_networks %}
            - type: vlan
              mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }}
              vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }}
              addresses:
              - ip_netmask:
                  {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }}
              routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }}
          {% endfor %}
        edpm_nodes_validation_validate_controllers_icmp: false
        edpm_nodes_validation_validate_gateway_icmp: false
        edpm_os_net_config_mappings:
          net_config_data_lookup:
            edpm-compute:
              nic2: eth1
        edpm_sshd_allowed_ranges:
        - 0.0.0.0/0
        enable_debug: false
        gather_facts: false
        image_prefix: openstack
        image_tag: 39fc4cb70f516d8e9b48225bc0a253ef
        neutron_public_interface_name: eth1
        registry_url: quay.io/podified-antelope-centos9
        timesync_ntp_servers:
        - hostname: pool.ntp.org
      ansibleVarsFrom:
      - configMapRef:
          name: network-config-template-ipam
        prefix: edpm_
      - configMapRef:
          name: neutron-edpm-ipam
        prefix: neutron_
    ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret
  nodes:
    edpm-compute-0:
      ansible:
        ansibleHost: 192.168.122.100
      hostName: compute-0
      networks:
      - defaultRoute: false
        fixedIP: 192.168.122.100
        name: ctlplane
        subnetName: subnet1
      - name: internalapi
        subnetName: subnet1
      - name: storage
        subnetName: subnet1
      - name: tenant
        subnetName: subnet1
  preProvisioned: true
  services:
  - repo-setup
  - redhat
  - bootstrap
  - download-cache
  - configure-network
  - validate-network
  - install-os
  - configure-os
  - ssh-known-hosts
  - run-os
  - reboot-os
  - install-certs
  - ovn
  - neutron-metadata
  - libvirt
  - nova
  - telemetry
  tlsEnabled: true
