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

User resource on AIX returns a non-working structure or 'attributes'

    Details

      Description

      The `user` resource on AIX returns back non-working Puppet code for the 'attributes' key.

      Example:

      puppet resource user root

      # puppet resource user root | tee /tmp/root.pp
       
      user { 'root':
        ensure           => 'present',
        attributes       => {'account_locked' => 'false', 'admin' => 'true', 'auditclasses' => 'general', 'auth1' => 'SYSTEM', 'auth2' => 'NONE', 'core' => '-1', 'cpu' => '-1', 'daemon' => 'true', 'data' => '-1', 'fsize' => '-1', 'histexpire' => '0', 'histsize' => '0', 'host_last_login' => 'njros1ud710.prudential.com', 'host_last_unsuccessful_login' => 'njros1ud710.prudential.com', 'login' => 'true', 'loginretries' => '0', 'maxexpired' => '-1', 'maxrepeats' => '8', 'minalpha' => '0', 'mindiff' => '0', 'mindigit' => '0', 'minlen' => '0', 'minloweralpha' => '0', 'minother' => '0', 'minspecialchar' => '0', 'minupperalpha' => '0', 'name' => 'root', 'nofiles' => '2000', 'pwdwarntime' => '0', 'registry' => 'files', 'rlogin' => 'true', 'rss' => '-1', 'stack' => '-1', 'su' => 'true', 'sugroups' => 'ALL', 'system' => 'compat', 'time_last_login' => '1407248916', 'time_last_unsuccessful_login' => '1407184651', 'tpath' => 'nosak', 'tty_last_login' => '/dev/pts/1', 'tty_last_unsuccessful_login' => 'ssh', 'ttys' => 'ALL', 'umask' => '22', 'unsuccessful_login_count' => '0'},
        comment          => 'root',
        expiry           => '2032-12-31',
        gid              => '0',
        groups           => ['system', 'bin', 'sys', 'security', 'cron', 'audit', 'lp'],
        home             => '/',
        password         => 'WuthH/s1ny/5s',
        password_max_age => '0',
        password_min_age => '0',
        shell            => '/bin/ksh',
        uid              => '0',
      }
      

      And then running the same code through puppet apply:

      puppet apply root.pp

      # puppet apply /tmp/root.pp
      Notice: Compiled catalog for myhost.example.com in environment production in 0.28 seconds
      Error: Parameter attributes failed on User[root]: Attributes value pairs must be separated by an = at /tmp/root.pp:14
      Wrapped exception:
      Attributes value pairs must be separated by an =
      
      

      The issue seems to stem from the attributes field. `puppet resource` outputs a key/value object for attributes, while puppet apply seems to expect an array with key=value parts in it as a string.

      Changing it to an array of key=value pairs results in a still broken setup. Puppet resource outputs several key/value pairs that are NOT items that can be changed via the chuser command it runs under the covers. It should not return the 'name' or the 'system' keys.

      This was my working root.pp file:

      root.pp

      user { 'root':
        ensure           => 'present',
        attributes => ['account_locked=false', 'admin=true', 'auditclasses=general', 'auth1=SYSTEM', 'auth2=NONE', 'core=-1', 'cpu=-1', 'daemon=true', 'data=-1', 'fsize=-1', 'histexpire=0', 'histsize=0', 'host_last_login=njros1ud710.prudential.com', 'host_last_unsuccessful_login=njros1ud710.prudential.com', 'login=true', 'loginretries=0', 'maxexpired=-1', 'maxrepeats=8', 'minalpha=0', 'mindiff=0', 'mindigit=0', 'minlen=0', 'minloweralpha=0', 'minother=0', 'minspecialchar=0', 'minupperalpha=0', 'nofiles=2000', 'pwdwarntime=0', 'registry=files', 'rlogin=true', 'rss=-1', 'stack=-1', 'su=true', 'sugroups=adm', 'time_last_login=1407248916', 'time_last_unsuccessful_login=1407184651', 'tpath=nosak', 'tty_last_login=/dev/pts/1', 'tty_last_unsuccessful_login=ssh', 'ttys=ALL', 'umask=22', 'unsuccessful_login_count=0'],
        comment          => 'root',
        expiry           => '2032-12-31',
        gid              => '0',
        groups           => ['system', 'bin', 'sys', 'security', 'cron', 'audit', 'lp'],
        home             => '/',
        password         => 'fakepass',
        password_max_age => '0',
        password_min_age => '0',
        shell            => '/bin/ksh',
        uid              => '0',
      }
      

      PS:

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  enis.inan Enis Inan
                  Reporter:
                  Ricapar Rich Acosta
                  QA Contact:
                  Narmadha Perumal
                • Votes:
                  2 Vote for this issue
                  Watchers:
                  9 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: