Method: LinuxUser#meta_info

Defined in:
lib/resources/user.rb

#meta_info(username) ⇒ Object



247
248
249
250
251
252
253
254
255
256
# File 'lib/resources/user.rb', line 247

def meta_info(username)
  cmd = inspec.command("getent passwd #{username}")
  return nil if cmd.exit_status != 0
  # returns: root:x:0:0:root:/root:/bin/bash
  passwd = parse_passwd_line(cmd.stdout.chomp)
  {
    home: passwd['home'],
    shell: passwd['shell'],
  }
end