Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-9195

Unable to modify user account expiry date when forcelocal == true

    XMLWordPrintable

Details

    • Coremunity
    • Platform Core KANBAN
    • Needs Assessment
    • 34197
    • 1
    • Bug Fix
    • When `forcelocal` is true and `expiry` is set, we now use `usermod` to manage a user rather than `lusermod`. `lusermod` does not support `-e`, and so would fail the puppet run.
    • Needs Assessment

    Description

      Puppet Version: 5.5.6 6.0.1
      Puppet Server Version: 5.2.0
      OS Name/Version: CentOS 7.5

      Similar to https://tickets.puppetlabs.com/browse/PUP-8470 (where lusermod does not support -G), lusermod does not support -e either.

      user {"someuser":
        ensure => present,
        forcelocal => true,
        expiry => "2019-05-31"
      }
      

      Desired Behavior:
      user type allowed to modify local user's account expiry parameter

      Actual Behavior:

      Error: Could not set expiry on user[someuser]: Execution of '/sbin/lusermod -e 2019-05-31 someuser' returned 1: Error parsing arguments: unknown option.
      Usage: lusermod [-imLU?] [-i|--interactive] [-c|--gecos STRING]
              [-d|--directory STRING] [-m|--movedirectory] [-s|--shell STRING]
              [-u|--uid NUM] [-g|--gid NUM] [-l|--login STRING]
              [-P|--plainpassword STRING] [-p|--password STRING] [-L|--lock]
              [-U|--unlock] [--commonname=STRING] [--givenname=STRING]
              [--surname=STRING] [--roomnumber=STRING] [--telephonenumber=STRING]
              [--homephone=STRING] [-?|--help] [--usage] [OPTION...] user
      Error: /Stage[main]/Main/User[someuser]/expiry: change from 'absent' to '2019-05-31' failed: Could not set expiry on user[someuser]: Execution of '/sbin/lusermod -e  someuser' returned 1: Error parsing arguments: unknown option.
      Usage: lusermod [-imLU?] [-i|--interactive] [-c|--gecos STRING]
              [-d|--directory STRING] [-m|--movedirectory] [-s|--shell STRING]
              [-u|--uid NUM] [-g|--gid NUM] [-l|--login STRING]
              [-P|--plainpassword STRING] [-p|--password STRING] [-L|--lock]
              [-U|--unlock] [--commonname=STRING] [--givenname=STRING]
              [--surname=STRING] [--roomnumber=STRING] [--telephonenumber=STRING]
              [--homephone=STRING] [-?|--help] [--usage] [OPTION...] user
      

      Attachments

        Issue Links

          Activity

            People

              melissa Melissa Stone
              alexjfisher Alexander Fisher
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support