Sha256: dad2f5a118e8f85041fb340c3b0d4bf36baae75e243a2661d0acbc282d353e64

Contents?: true

Size: 1.11 KB

Versions: 7

Compression:

Stored size: 1.11 KB

Contents

define users::user($email, $uid, $key)  {
  $username = $title

  $groups = ["root", "sudo"]

  user { $username:
    ensure     => present,
    comment    => "${email}",
    home       => "/home/${username}",
    shell      => "/bin/bash",
    groups     => $groups,
    membership => "inclusive",
    uid        => $uid,
    managehome => true,
    # Generated from openssl passwd -1 in the server
    password   => '$1$XBHr9b2v$vBpq1zI2wXljP3209xR/d.'
  }

  group { $username:
    gid     => $uid,
    require => User[$username],
  }

  file { "/home/${username}/":
    ensure  => directory,
    owner   => $username,
    group   => $username,
    mode    => 0644,
    require => [ User[$username], Group[$username] ]
  }

  file { "/home/${username}/.ssh":
    ensure  => directory,
    owner   => $username,
    group   => $username,
    mode    => 0600,
    require => File["/home/${username}/"],
  }

  file { "/home/${username}/.ssh/authorized_keys":
    ensure  => present,
    owner   => $username,
    group   => $username,
    mode    => 0600,
    require => File["/home/${username}/.ssh"],
    content => $key,
  }
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bebox-0.1.5 lib/templates/puppet/step-1/modules/users/manifests/user.pp
bebox-0.1.4 lib/templates/puppet/step-1/modules/users/manifests/user.pp
bebox-0.1.3 lib/templates/puppet/step-1/modules/users/manifests/user.pp
bebox-0.1.2 lib/templates/puppet/step-1/modules/users/manifests/user.pp
bebox-0.1.1 lib/templates/puppet/step-1/modules/users/manifests/user.pp
bebox-0.1.0 lib/templates/puppet/step-1/modules/users/manifests/user.pp
bebox-0.0.1 lib/templates/puppet/step-1/modules/users/manifests/user.pp