Eu descobri como resolver meu problema graças ao @Artefacto:
Eu criei um novo fato que apenas lista casas:
Facter.add(:list_home) do
setcode do
Facter::Core::Execution.exec('/bin/ls /home/').split("\n")
end
end
E modifiquei meu manifesto para fazer uma iteração em cada casa:
class users::config {
$::list_home.each |String $user| {
exec {"check_ssh_dir_${user}":
command => '/bin/true',
onlyif => "/usr/bin/test -e /home/${user}/.ssh",
}
file {"/home/${user}/.ssh":
ensure => directory,
owner => "${user}",
group => "domain users",
mode => "700",
require => Exec["check_ssh_dir_${user}"],
}
file {"/home/${user}/.bashrc":
source => [ "puppet:///modules/users/${user}/bashrc", "puppet:///modules/users/basics/bashrc"],
owner => "${user}",
group => "domain users",
mode => "640",
}
file {"/home/${user}/.bash_profile":
source => [ "puppet:///modules/users/${user}/bash_profile", "puppet:///modules/users/basics/bash_profile"],
owner => "${user}",
group => "domain users",
mode => "640",
}
file {"/home/${user}/.ssh/authorized_keys":
source => [ "puppet:///modules/users/${user}/ssh/authorized_keys", "puppet:///modules/users/basics/ssh/authorized_keys"],
owner => "${user}",
group => "domain users",
mode => "600",
}
}
}
Agora não falhei devido a dependências.