21457062 Puppet should be able to change a role's shell s11u3-sru
authorSowrabha H G<sowrabha.hg@oracle.com>
Tue, 15 Mar 2016 22:00:57 -0700
branchs11u3-sru
changeset 5611 2902f3259bbf
parent 5573 56564f280aba
child 5620 d8cd6c0a1222
21457062 Puppet should be able to change a role's shell
components/ruby/puppet/patches/puppet-09-role-shell.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ruby/puppet/patches/puppet-09-role-shell.patch	Tue Mar 15 22:00:57 2016 -0700
@@ -0,0 +1,38 @@
+In-house patch to fix upstream bug PUP-5234 which adds attrible "shell" to the user provider.
+https://tickets.puppetlabs.com/browse/PUP-5234
+The patch has been submitted upstream but not yet accepted.
+
+--- puppet-3.6.2/lib/puppet/provider/user/user_role_add.rb.orig  Thu Jul 30 22:51:24 2015
++++ puppet-3.6.2/lib/puppet/provider/user/user_role_add.rb	Mon Aug  3 23:22:44 2015
[email protected]@ -12,6 +12,7 @@
+   options :home, :flag => "-d", :method => :dir
+   options :comment, :method => :gecos
+   options :groups, :flag => "-G"
++  options :shell, :flag => "-s"
+   options :roles, :flag => "-R"
+   options :auths, :flag => "-A"
+   options :profiles, :flag => "-P"
[email protected]@ -26,8 +27,23 @@
+     value !~ /\s/
+   end
+ 
++  def shell=(value)
++    check_valid_shell
++    set("shell", value)
++  end
++
+   has_features :manages_homedir, :allows_duplicates, :manages_solaris_rbac, :manages_passwords, :manages_password_age
++  has_features :manages_shell
+ 
++  def check_valid_shell
++    unless File.exists?(@resource.should(:shell))
++      raise(Puppet::Error, "Shell #{@resource.should(:shell)} must exist")
++    end
++    unless File.executable?(@resource.should(:shell).to_s)
++      raise(Puppet::Error, "Shell #{@resource.should(:shell)} must be executable")
++    end
++  end
++
+   #must override this to hand the keyvalue pairs
+   def add_properties
+     cmd = []