components/puppet/patches/puppet-03-zonetype.patch
changeset 1198 f9a4100102d8
equal deleted inserted replaced
1197:2cb98ee9bc03 1198:f9a4100102d8
       
     1 The puppet zone type changes that enable basic functionality with Solaris 11
       
     2 zones. Includes the type changes to fix a bug introduced by the putback of
       
     3 15886 into the puppet gate that prevented zones networking from being created.  
       
     4 
       
     5 --- puppet-3.0.1/lib/puppet/type/zone.rb.orig	2013-02-15 16:08:16.530618507 -0700
       
     6 +++ puppet-3.0.1/lib/puppet/type/zone.rb	2013-02-15 08:24:18.530373776 -0700
       
     7 @@ -133,6 +133,12 @@
       
     8      isnamevar
       
     9    end
       
    10  
       
    11 +  newparam(:config_profile) do
       
    12 +    desc "Path to the config_profile to use for installation of a solaris zone.
       
    13 +          This is set when providing a sysconfig profile instead of running the
       
    14 +	  sysconfig SCI tool on first boot of the zone."
       
    15 +  end
       
    16 +
       
    17    newparam(:id) do
       
    18      desc "The numerical ID of the zone.  This number is autogenerated
       
    19        and cannot be changed."
       
    20 @@ -161,19 +167,44 @@
       
    21  
       
    22      # overridden so that we match with self.should
       
    23      def insync?(is)
       
    24 -      return true unless is
       
    25 -      is = [] if is == :absent
       
    26 +      is = [] if is == :absent or is.nil?
       
    27        is.sort == self.should.sort
       
    28      end
       
    29    end
       
    30  
       
    31    newproperty(:iptype) do
       
    32 -    desc "The IP stack type of the zone."
       
    33 -    defaultto :shared
       
    34 +    desc "The IP stack type of the zone. The default is to exclusive."
       
    35 +    if ['5.11', '5.12'].include? Facter.value(:kernelrelease)
       
    36 +       defaultto :exclusive
       
    37 +    else
       
    38 +       defaultto :shared
       
    39 +    end
       
    40      newvalue :shared
       
    41      newvalue :exclusive
       
    42    end
       
    43  
       
    44 +  newproperty(:net_resource, :parent => Puppet::Property::List) do
       
    45 +    desc "The net resource assigned network resource to a zone. The net
       
    46 +          resource represents the assignment of a physical network resource
       
    47 +	   to a zone. The anet resource represents the automatic creation of a
       
    48 +	   network resource for an exclusive-IP zone. This property only needs
       
    49 +          to be set if additional network resources are desired. By default
       
    50 +          an anet resource is created for the zone. To add additional net
       
    51 +          or anet services"
       
    52 +    newvalue :anet
       
    53 +    newvalue :net
       
    54 +
       
    55 +    def should
       
    56 +      @should
       
    57 +    end
       
    58 +
       
    59 +    # overridden so that we match with self.should
       
    60 +    def insync?(is)
       
    61 +      is = [] if is == :absent or is.nil?
       
    62 +      is.sort == self.should.sort
       
    63 +    end
       
    64 +  end
       
    65 +
       
    66    newproperty(:autoboot, :boolean => true) do
       
    67      desc "Whether the zone should automatically boot."
       
    68      defaultto true
       
    69 @@ -218,8 +249,7 @@
       
    70  
       
    71      # overridden so that we match with self.should
       
    72      def insync?(is)
       
    73 -      return true unless is
       
    74 -      is = [] if is == :absent
       
    75 +      is = [] if is == :absent or is.nil?
       
    76        is.sort == self.should.sort
       
    77      end
       
    78