name: ovs-configuration.service
enabled: {{if eq .NetworkType "OVNKubernetes" "OpenShiftSDN"}}true{{else}}false{{end}}
contents: |
  [Unit]
  Description=Configures OVS with proper host networking configuration
  # Removal of this file signals firstboot completion
  ConditionPathExists=!/etc/ignition-machine-config-encapsulated.json
  # This service is used to move a physical NIC into OVS and reconfigure OVS to use the host IP
  Requires=openvswitch.service
  Wants=NetworkManager-wait-online.service
  After=NetworkManager-wait-online.service openvswitch.service network.service
  Before=network-online.target kubelet.service crio.service node-valid-hostname.service

  [Service]
  # Need oneshot to delay kubelet
  Type=oneshot
  ExecStart=/usr/local/bin/configure-ovs.sh {{.NetworkType}}
  StandardOutput=journal+console
  StandardError=journal+console

  [Install]
  WantedBy=network-online.target
