Feature #2224

Add an "Expire" parameter to the User type reference

Added by Mike Hanby about 3 years ago. Updated over 1 year ago.

Status:Closed Start date:05/05/2009
Priority:Normal Due date:
Assignee:Markus Roberts % Done:

0%

Category:user
Target version:2.6.2
Affected Puppet version:0.24.8 Branch:http://github.com/MarkusQ/puppet/tree/ticket/2.6.x/2224
Keywords:
Votes: 0

Description

It’d be very hand to have the ability to set an account expiration date for user accounts via the puppet user type.

For example, in Linux, I can set an account to be disabled on a specific date using:

sudo /usr/sbin/usermod -e 2009-12-31 joeblow

It’d be great to be able to do this via the user type so that the change happens on all hosts where this account is ‘realize’d:

    @user { "joeblow":
        ensure  => "present",
        uid     => "11100",
        gid     => "10001",
        comment => "Joe Blow",
        managehome => true,
        shell   => "/bin/bash",
        expire  => "2009-12-31",
    }

Related issues

related to Puppet - Feature #3046: Support for changing of password aging and expiration val... Closed 01/14/2010

History

Updated by James Turnbull about 3 years ago

  • Category set to user
  • Status changed from Unreviewed to Accepted
  • Assignee set to Puppet Community
  • Target version set to 4

Updated by James Turnbull almost 3 years ago

  • Assignee deleted (Puppet Community)

Updated by James Turnbull over 1 year ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Target version changed from 4 to 2.6.2
  • Branch set to http://github.com/deanwilson/puppet/tree/user_expiry

Updated by Nick Lewis over 1 year ago

  • Status changed from In Topic Branch Pending Review to Ready For Checkin

Updated by Markus Roberts over 1 year ago

  • Status changed from Ready For Checkin to Code Insufficient

This needs to be based on 2.6.x if it’s to be merged in 2.6.2.

Updated by Markus Roberts over 1 year ago

  • Assignee set to Markus Roberts

I’ll rebase.

Updated by Markus Roberts over 1 year ago

  • Status changed from Code Insufficient to Ready For Checkin
  • Branch changed from http://github.com/deanwilson/puppet/tree/user_expiry to http://github.com/MarkusQ/puppet/tree/ticket/2.6.x/2224

Updated by Markus Roberts over 1 year ago

  • Status changed from Ready For Checkin to Code Insufficient

As written, this causes a test failure:

1)
'Puppet::Type::User::ProviderUseradd when calling addcmd should return an array with full command' FAILED
expected: ["useradd", "-G", "somegroup", "-o", "-m", "someuser"],
     got: ["useradd", "-G", "somegroup", "-o", "-m", "-e fakeval", "someuser"] (using ==)
./spec/unit/provider/user/useradd_spec.rb:112:
/home/markus/projects/puppet/puppet/spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:21:in `run'
/home/markus/projects/puppet/puppet/spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:16:in `each'
/home/markus/projects/puppet/puppet/spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:16:in `run'

Looks pretty straight forward.

Updated by Markus Roberts over 1 year ago

  • Status changed from Code Insufficient to Ready For Checkin

Adjusting the test’s definition of “the full command” to include the expiry and adding a parallel case for when the expiry isn’t specified removes the failure and brings the test into line with the code.

Updated by Markus Roberts over 1 year ago

  • Status changed from Ready For Checkin to Closed

Pushed to 2.6.x as commit:34f87cfd74e5c93365da11a5e676f513e8819196

Also available in: Atom PDF