Bug #11200

Creating users on aix gives an error

Added by Michael Bryant 6 months ago. Updated 2 months ago.

Status:Accepted Start date:12/06/2011
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:provider
Target version:2.7.x
Affected Puppet version:2.7.0 Branch:
Keywords:AIX user provider puppet
Votes: 1

Description

debug: User[miketest](provider=aix): Executing '/usr/sbin/lsgroup -a id sysadm'
debug: User[miketest](provider=aix): Executing '/usr/bin/mkuser id=32400 groups= pgrp=sysadm home=/home/test shell=/bin/bash miketest'
err: /Stage[main]//Node[aix]/User[miketest]/ensure: change from absent to present failed: Could not set 'present on ensure: undefined method `ia_module' for Puppet::Type::User::ProviderAix:Class at /etc/puppet/manifests/site.pp:103

Config:

                user {  "miketest":
                        ensure   => present,
                        uid      => 32400,
                        gid      => sysadm,
                        comment  => "test",
                        home     => "/home/test",
                        password => "abc",
                        groups   => "",
                        shell    => "/bin/bash",
                }

Note: The creation of the user succeeds, however the failure causes any dependent resources to not run. A second invocation of puppet doesn’t give the error, it only seems to occur when puppet creates the user initially.


Related issues

related to Puppet - Bug #10915: The "provider can not handle attribute" error is misleading Accepted 11/17/2011

History

Updated by Josh Cooper 6 months ago

  • Status changed from Unreviewed to Accepted
  • Target version set to 2.7.x
  • Affected Puppet version changed from 2.7.6 to 2.7.0

The class method ia_module was removed in commit:fb339cbbc17cd14ba34df624fe9a2b9c74640eb5 while fixing #5432 but the code that called it was not updated. It looks like the accessor method was replaced with the ia_load_module parameter. Can you try replacing these lines in lib/puppet/provider/user/aix.rb:

    cmd = [self.class.command(:chpasswd),"-R", self.class.ia_module,
           '-e', '-c', user]

with:

    cmd = [self.class.command(:chpasswd), get_ia_module_args, '-e', '-c', user].flatten

Updated by Michael Bryant 6 months ago

This change works, cheers

Updated by Josh Cooper 6 months ago

Hi Michael, It’d be great if you could submit patches for this and #10915. The process is described here. Also make sure to sign the Community License Agreement.

Updated by Andy Sykes 2 months ago

A fix for this is in pull request 585: https://github.com/puppetlabs/puppet/pull/585

Apologies if I’ve messed something up; this is my first attempt to supply a patch to upstream (I normally keep a simple diff of little changes downstream).

I’ve got a couple more fixes for AIX-specific stuff that don’t seem to have bugs filed for (notably a problem setting AIX LAM attributes on users, if the user doesn’t yet exist).

Also available in: Atom PDF