## puppet_cd::main::user.pp
# Module name: puppet_cd
# Author: Arne Teuke (arne_teuke@confdroid)
# @summary  Class manages user settings for the puppet_cd module.
###############################################################################
class puppet_cd::main::user (

) inherits puppet_cd::params {
  if ($fqdn == $pt_pm_fqdn) and ($pt_manage_user == true) {
    user { $pt_user:
      ensure     => present,
      name       => $pt_user,
      allowdupe  => false,
      comment    => $pt_user_comment,
      gid        => $pt_user,
      managehome => true,
      home       => $pt_user_home,
      shell      => $pt_user_shell,
    }

    group { $pt_user:
      ensure    => present,
      name      => $pt_user,
      allowdupe => false,
    }
  }

  if ($fqdn == $pt_db_fqdn) and ($pt_manage_db_user == true) {
    user { $pt_db_user:
      ensure     => present,
      name       => $pt_db_user,
      allowdupe  => false,
      comment    => $pt_db_user_comment,
      gid        => $pt_db_user,
      managehome => true,
      home       => $pt_db_user_home,
      shell      => $pt_db_user_shell,
    }

    group { $pt_db_user:
      ensure    => present,
      name      => $pt_db_user,
      allowdupe => false,
    }
  }
}
