Is there an issue with using subscribe? So in my virtual resource definition I have:
define accounts::virtual ($uid,$realname,$pass) {
user { $title:
ensure => 'present',
uid => $uid,
gid => $title,
shell => '/bin/bash',
home => "/home/${title}",
comment => $realname,
# password => $pass,
password_max_age => '90',
password_min_age => '0',
groups => ['sudo'],
managehome => true,
require => Group[$title],
}
group { $title:
gid => $uid,
}
exec { "/usr/sbin/usermod -p \'$pass\' $title":
refreshonly => true,
subscribe => User[$title],
# logoutput => true,
}
...
...
...
I guess the only gotcha I see is if something changes and causing the user to get updated, it will reset the password to the "default"