components/ruby/puppet/files/solaris/lib/puppet/type/pkg_publisher.rb
branchs11u3-sru
changeset 5905 085130968f36
parent 3458 4912663e9858
--- a/components/ruby/puppet/files/solaris/lib/puppet/type/pkg_publisher.rb	Fri Apr 29 08:21:43 2016 -0700
+++ b/components/ruby/puppet/files/solaris/lib/puppet/type/pkg_publisher.rb	Tue May 03 02:32:08 2016 -0700
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 
 require 'puppet/property/list'
@@ -61,7 +61,6 @@
             end
         end
     end
-
     newproperty(:enable) do
         desc "Enable the publisher"
         newvalues(:true, :false)
@@ -99,4 +98,31 @@
     newproperty(:sslcert) do
         desc "Specify the client SSL certificate"
     end
+
+    newproperty(:mirror, :parent => Puppet::Property::List) do
+        desc "Which mirror URI(s) to set.  For multiple mirrors, specify them
+              as a list"
+	
+        # ensure should remains an array
+        def should
+            @should
+        end
+
+        def insync?(is)
+            is = [] if is == :absent or is.nil?
+            is.sort == self.should.sort
+        end
+
+        def retrieve
+            provider.mirror
+        end
+        
+        munge do |value|
+            if value.start_with? "file" and value.end_with? "/"
+                value = value.chomp("/")
+            else
+                value
+            end
+        end
+    end
 end