summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/platform/provider_mapping.rb3
-rw-r--r--lib/chef/provider/user/aix.rb45
-rw-r--r--lib/chef/providers.rb1
3 files changed, 48 insertions, 1 deletions
diff --git a/lib/chef/platform/provider_mapping.rb b/lib/chef/platform/provider_mapping.rb
index ebcc8c2fe3..43003ecef3 100644
--- a/lib/chef/platform/provider_mapping.rb
+++ b/lib/chef/platform/provider_mapping.rb
@@ -365,7 +365,8 @@ class Chef
:mount => Chef::Provider::Mount::Aix,
:ifconfig => Chef::Provider::Ifconfig::Aix,
:cron => Chef::Provider::Cron::Aix,
- :package => Chef::Provider::Package::Aix
+ :package => Chef::Provider::Package::Aix,
+ :user => Chef::Provider::User::Aix
}
},
:exherbo => {
diff --git a/lib/chef/provider/user/aix.rb b/lib/chef/provider/user/aix.rb
new file mode 100644
index 0000000000..feaa8f8e01
--- /dev/null
+++ b/lib/chef/provider/user/aix.rb
@@ -0,0 +1,45 @@
+#
+# Copyright:: Copyright (c) 2012 Opscode, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+class Chef
+ class Provider
+ class User
+ class Aix < Chef::Provider::User::Useradd
+
+ UNIVERSAL_OPTIONS = [[:comment, "-c"], [:gid, "-g"], [:shell, "-s"], [:uid, "-u"]]
+
+ def create_user
+ super
+ add_password
+ end
+
+ def manage_user
+ add_password
+ super
+ end
+
+ private
+ def add_password
+ if @current_resource.password != @new_resource.password && @new_resource.password
+ Chef::Log.debug("#{@new_resource.username} setting password to #{@new_resource.password}")
+ command = "echo #{@new_resource.username}:#{@new_resource.password} | chpasswd"
+ shell_out!(command)
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/lib/chef/providers.rb b/lib/chef/providers.rb
index c89037df31..3c9e94e6f7 100644
--- a/lib/chef/providers.rb
+++ b/lib/chef/providers.rb
@@ -91,6 +91,7 @@ require 'chef/provider/user/pw'
require 'chef/provider/user/useradd'
require 'chef/provider/user/windows'
require 'chef/provider/user/solaris'
+require 'chef/provider/user/aix'
require 'chef/provider/group/aix'
require 'chef/provider/group/dscl'