From 6e202df4ea45931d872ff2d14dbf3e3737ade375 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Harald=20Jens=C3=A5s?= <hjensas@redhat.com>
Date: Sat, 28 Sep 2019 01:39:20 +0200
Subject: [PATCH] Fix Ironic configuration for IPv6

When using IPv6 for provisioning baremtal nodes ironic.conf
needs:
  - [pxe]/ip_version must be set to '6'. Add parameter
    IronicIpVersion.
  - [deploy]/http_url must have the IPv6 address wrapped.
    Use the $NETWORK_uri value from hiera which carries
    an ip address fit for use in url.

Related-Bug: #1845746
Depends-On: Ib29adccc8378bd3e2a46b7d2ca3cfacba55e7674
Change-Id: I6384e11dd68cdbf2179545caae2c818fd1a6b23e
---
 deployment/ironic/ironic-conductor-container-puppet.yaml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/deployment/ironic/ironic-conductor-container-puppet.yaml b/deployment/ironic/ironic-conductor-container-puppet.yaml
index 38bc250f59..5d8b0c5636 100644
--- a/deployment/ironic/ironic-conductor-container-puppet.yaml
+++ b/deployment/ironic/ironic-conductor-container-puppet.yaml
@@ -232,6 +232,10 @@ parameters:
     default: []
     description: List of additional architectures to enable.
     type: comma_delimited_list
+  IronicIpVersion:
+    default: 4
+    description: The IP version that will be used for PXE booting.
+    type: string
 
 conditions:
   default_deploy_interface_unset: {equals : [{get_param: IronicDefaultDeployInterface}, '']}
@@ -306,7 +310,7 @@ outputs:
             ironic_conductor_http_host:
               str_replace:
                  template:
-                   "%{hiera('$NETWORK')}"
+                   "%{hiera('$NETWORK_uri')}"
                  params:
                    $NETWORK: {get_param: [ServiceNetMap, IronicNetwork]}
             ironic::conductor::http_url:
@@ -317,6 +321,7 @@ outputs:
                   - {get_param: IronicIPXEPort}
             ironic::drivers::pxe::ipxe_enabled: {get_param: IronicIPXEEnabled}
             ironic::drivers::pxe::ipxe_timeout: {get_param: IronicIPXETimeout}
+            ironic::drivers::pxe::ip_version: {get_param: IronicIpVersion}
             # NOTE: bind IP is found in hiera replacing the network name with the
             # local node IP for the given network; replacement examples
             # (eg. for internal_api):