Add initial meta-stx to support StarlingX build
[pti/rtp.git] / meta-stx / recipes-support / puppet / files / network / puppet-network-support-ipv6.patch
diff --git a/meta-stx/recipes-support/puppet/files/network/puppet-network-support-ipv6.patch b/meta-stx/recipes-support/puppet/files/network/puppet-network-support-ipv6.patch
new file mode 100644 (file)
index 0000000..b6d2f3c
--- /dev/null
@@ -0,0 +1,46 @@
+Index: packstack/puppet/modules/network/lib/puppet/provider/network_config/redhat.rb
+--- a/packstack/puppet/modules/network/lib/puppet/provider/network_config/redhat.rb
++++ b/packstack/puppet/modules/network/lib/puppet/provider/network_config/redhat.rb
+@@ -224,6 +224,11 @@
+     pairs = self.unmunge props
++    ip_version = provider.send(:family)
++    if (ip_version.to_s == "inet6")
++        pairs = self.ipv6_fixup pairs
++    end
++
+     content = pairs.inject('') do |str, (key, val)|
+       str << %{#{key}=#{val}\n}
+     end
+@@ -259,6 +264,30 @@
+     pairs
+   end
++  def self.ipv6_fixup(pairs)
++    pairs['IPV6INIT'] = 'yes'
++
++    if (pairs.include? 'NETMASK' and pairs.include? 'IPADDR')
++        pairs['IPV6ADDR'] =  pairs['IPADDR'].to_s + "/" + pairs['NETMASK'].to_s
++        pairs.delete('NETMASK')
++        pairs.delete('IPADDR')
++    elsif (pairs.include? 'IPADDR')
++        pairs['IPV6ADDR'] = pairs['IPADDR'].to_s
++        pairs.delete('IPADDR')
++    end
++
++    if (pairs.include? 'GATEWAY')
++        pairs['IPV6_DEFAULTGW'] = pairs['GATEWAY']
++        pairs.delete('GATEWAY')
++    end
++
++    if (pairs['BOOTPROTO'].to_s == 'dhcp')
++        pairs['DHCPV6C'] = 'yes'
++        pairs['DHCLIENTARGS'] = '-1'
++    end
++    pairs
++  end
++
+   def self.header
+     str = <<-HEADER
+ # HEADER: This file is is being managed by puppet. Changes to