components/ruby/puppet/files/solaris/lib/puppet/type/pkg_publisher.rb
changeset 4106 ac78e6a526fe
parent 2081 1f1144fb0e4e
--- a/components/ruby/puppet/files/solaris/lib/puppet/type/pkg_publisher.rb	Fri Apr 10 16:26:11 2015 -0700
+++ b/components/ruby/puppet/files/solaris/lib/puppet/type/pkg_publisher.rb	Mon Apr 13 03:04:30 2015 -0700
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2015, 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