Add initial meta-stx to support StarlingX build
[pti/rtp.git] / meta-stx / recipes-support / puppet / files / network / puppet-network-support-ipv6.patch
1 Index: packstack/puppet/modules/network/lib/puppet/provider/network_config/redhat.rb
2 --- a/packstack/puppet/modules/network/lib/puppet/provider/network_config/redhat.rb
3 +++ b/packstack/puppet/modules/network/lib/puppet/provider/network_config/redhat.rb
4 @@ -224,6 +224,11 @@
5  
6      pairs = self.unmunge props
7  
8 +    ip_version = provider.send(:family)
9 +    if (ip_version.to_s == "inet6")
10 +        pairs = self.ipv6_fixup pairs
11 +    end
12 +
13      content = pairs.inject('') do |str, (key, val)|
14        str << %{#{key}=#{val}\n}
15      end
16 @@ -259,6 +264,30 @@
17      pairs
18    end
19  
20 +  def self.ipv6_fixup(pairs)
21 +    pairs['IPV6INIT'] = 'yes'
22 +
23 +    if (pairs.include? 'NETMASK' and pairs.include? 'IPADDR')
24 +        pairs['IPV6ADDR'] =  pairs['IPADDR'].to_s + "/" + pairs['NETMASK'].to_s
25 +        pairs.delete('NETMASK')
26 +        pairs.delete('IPADDR')
27 +    elsif (pairs.include? 'IPADDR')
28 +        pairs['IPV6ADDR'] = pairs['IPADDR'].to_s
29 +        pairs.delete('IPADDR')
30 +    end
31 +
32 +    if (pairs.include? 'GATEWAY')
33 +        pairs['IPV6_DEFAULTGW'] = pairs['GATEWAY']
34 +        pairs.delete('GATEWAY')
35 +    end
36 +
37 +    if (pairs['BOOTPROTO'].to_s == 'dhcp')
38 +        pairs['DHCPV6C'] = 'yes'
39 +        pairs['DHCLIENTARGS'] = '-1'
40 +    end
41 +    pairs
42 +  end
43 +
44    def self.header
45      str = <<-HEADER
46  # HEADER: This file is is being managed by puppet. Changes to