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

Puppet users with forcelocal are no longer idempotent

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: PUP 7.4.0, PUP 6.21.0
    • Fix Version/s: PUP 7.4.1, PUP 6.21.1
    • Component/s: None
    • Labels:
    • Template:
      PUP Bug Template
    • Team:
      Night's Watch
    • Sprint:
      NW - 2021-02-17
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Fix a regression where setting the `gid` parameter on a user resource with `forcelocal` on is not idempotent.
    • QA Risk Assessment:
      Needs Assessment

      Description

      Puppet Version: 7.4.0 and 6.21.0
      Puppet Server Version: Masterless to demonstrate issue
      OS Name/Version: CentOS 7

      Defining a `forcelocal` user results in Puppet constantly wanting to change the GID for the user.

      Desired Behavior:

      Idempotent apply of forcelocal user.

      Actual Behavior:

      [root@23aff6d4a202 /]# cat user-group.pp 
      user { 'keycloak':
        ensure     => 'present',
        name       => 'keycloak',
        forcelocal => true,
        shell      => '/sbin/nologin',
        gid        => 'keycloak',
        uid        => undef,
        home       => '/var/lib/keycloak',
        managehome => true,
        system     => true,
      }
      group { 'keycloak':
        ensure     => 'present',
        name       => 'keycloak',
        forcelocal => true,
        gid        => undef,
        system     => true,
      }
      [root@23aff6d4a202 /]# puppet apply user-group.pp 
      Notice: Compiled catalog for 23aff6d4a202 in environment production in 0.01 seconds
      Notice: /Stage[main]/Main/Group[keycloak]/ensure: created
      Notice: /Stage[main]/Main/User[keycloak]/ensure: created
      Notice: Applied catalog in 0.04 seconds
      [root@23aff6d4a202 /]# puppet apply user-group.pp 
      Notice: Compiled catalog for 23aff6d4a202 in environment production in 0.01 seconds
      Notice: /Stage[main]/Main/User[keycloak]/gid: gid changed '13' to 'keycloak'
      Notice: Applied catalog in 0.02 seconds
      
      

      I am fairly certain the issue resides in this change: https://tickets.puppetlabs.com/browse/PUP-10857

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gabriel.nagy Gabriel Nagy
              Reporter:
              treydock Trey Dockendorf
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support