Skip to content

Commit

Permalink
Merge pull request #34 from fdammeke/master
Browse files Browse the repository at this point in the history
Fix duplicate declaration errors -- Fix style issues
  • Loading branch information
fdammeke committed Aug 12, 2015
2 parents c129fa1 + 619b5f7 commit 3745cba
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions manifests/localuser.pp
Expand Up @@ -93,9 +93,9 @@
# logingroup => 'testgrp'
# }
#
define users::localuser ( $uid=undef, $logingroup=undef, $groups=[], $password='!',
define users::localuser ( $ensure='present',$uid=undef, $logingroup=undef, $groups=[], $password='!',
$comment='', $sshkey='', $sshkeytype='',
$ensure='present', $managehome=true,
$managehome=true,
$home="/home/${title}", $shell='/bin/bash',
$env_class=undef) {

Expand Down Expand Up @@ -179,19 +179,21 @@
User[$title] -> Class[$env_class]
}

file {'.bash_profile':
path => "${home}/.bash_profile",
ensure => present,
file { "${home}/.bash_profile":
ensure => present,
path => "${home}/.bash_profile",
require => User[$title]
}
file {'.bashrc':
path => "${home}/.bashrc",
ensure => present,
file { "${home}/.bashrc":
ensure => present,
path => "${home}/.bashrc",
require => User[$title]
}

file_line { "${home}/.bash_profile":
path => "${home}/.bash_profile",
line => '[ -d .profile.d ] && [ -f .profile.d/*.sh ] && source .profile.d/*.sh',
require => [User[$title],File['.bash_profile']]
require => [User[$title],File["${home}/.bash_profile"]]
}
file_line { "${home}/.bash_profile-remove":
ensure => absent,
Expand All @@ -203,7 +205,7 @@
file_line { "${home}/.bashrc":
path => "${home}/.bashrc",
line => '[ -d .profile.d ] && [ -z "$PS1" ] && [ -f .profile.d/*.sh ] && source .profile.d/*.sh',
require => [User[$title],File['.bashrc']]
require => [User[$title],File["${home}/.bashrc"]]
}
file_line { "${home}/.bashrc-remove":
ensure => absent,
Expand All @@ -220,4 +222,4 @@

}
}
}
}

0 comments on commit 3745cba

Please sign in to comment.