diff --git a/modules/openstack_project/manifests/users.pp b/modules/openstack_project/manifests/users.pp index 085daf092f..0772c7f948 100644 --- a/modules/openstack_project/manifests/users.pp +++ b/modules/openstack_project/manifests/users.pp @@ -1,6 +1,4 @@ class openstack_project::users { - include user::virtual - @user::virtual::localuser { 'mordred': realname => 'Monty Taylor', sshkeys => "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyxfIpVCvZyM8BIy7r7WOSIG6Scxq4afean1Pc/bej5ZWHXCu1QnhGbI7rW3sWciEhi375ILejfODl2TkBpfdJe/DL205lLkTxAa+FUqcZ5Ymwe+jBgCH5XayzyhRPFFLn07IfA/BDAjGPqFLvq6dCEHVNJIui6oEW7OUf6a3376YF55r9bw/8Ct00F9N7zrISeSSeZXbNR+dEqcsBEKBqvZGcLtM4jzDzNXw1ITPPMGaoEIIszLpkkJcy8u/13GIrbAwNrB2wjl6Mzj+N9nTsB4rFtxRXp31ZbytCH5G9CL/mFard7yi8NLVEJPZJvAifNVhooxGN06uAiTFE8EsuQ== mtaylor@qualinost\n", diff --git a/modules/user/manifests/virtual.pp b/modules/user/manifests/virtual.pp deleted file mode 100644 index 5631e6d2fc..0000000000 --- a/modules/user/manifests/virtual.pp +++ /dev/null @@ -1,38 +0,0 @@ -class user::virtual { - define localuser ($realname,$sshkeys='',$shell="/bin/bash") { - group { $title: - ensure => 'present' - } - - user { $title: - ensure => "present", - comment => $realname, - home => "/home/$title", - shell => $shell, - gid => $title, - groups => ['sudo','admin'], - membership => 'minimum', - managehome => true, # creates the home directory (does not actually manage it) - require => Group[$title], - } - - file { "${title}_sshdir": - name => "/home/$title/.ssh", - owner => $title, - group => $title, - mode => 700, - ensure => 'directory', - require => User[$title], - } - - file { "${title}_keys": - name => "/home/$title/.ssh/authorized_keys", - owner => $title, - group => $title, - mode => 400, - content => $sshkeys, - ensure => 'present', - require => File["${title}_sshdir"], - } - } -} diff --git a/modules/user/manifests/virtual/localuser.pp b/modules/user/manifests/virtual/localuser.pp new file mode 100644 index 0000000000..540f3034b0 --- /dev/null +++ b/modules/user/manifests/virtual/localuser.pp @@ -0,0 +1,45 @@ +define user::virtual::localuser( + $realname, + $sshkeys = '', + $shell = '/bin/bash' +) { + group { $title: + ensure => present, + } + + user { $title: + ensure => present, + comment => $realname, + gid => $title, + groups => [ + 'sudo', + 'admin', + ], + home => "/home/${title}", + managehome => true, # creates home directory, does not manage it + membership => 'minimum', + require => Group[$title], + shell => $shell, + } + + file { "${title}_sshdir": + ensure => directory, + name => "/home/${title}/.ssh", + owner => $title, + group => $title, + mode => '0700', + require => User[$title], + } + + file { "${title}_keys": + ensure => present, + content => $sshkeys, + group => $title, + mode => '0400', + name => "/home/${title}/.ssh/authorized_keys", + owner => $title, + require => File["${title}_sshdir"], + } +} + +# vim:sw=2:ts=2:expandtab:textwidth=79