Hello,
I cannot fully understand what you are trying to do, as I do not know what $copyPrivateCommand is, but I would advice against using an exec for copying a file, but just use a file resource instead:
file { "${letsencryptConfPath}/live/${letsencryptCommonName}/privkey.pem":
ensure => file,
source => "${appEtcConfPath}/ssl/private/${letsencryptCommonName}.letsencrypt.${letsencryptKeySize}.key",
notify => Exec['/usr/local/bin/apache.sh -c restart'],
# Or better: notify => Service['apache'],
}
This should only copy the private key if the source is different from the target and only in that case restart Apache.
N.B. Avoid exec resources as much as possible, as they often result in overly complex Puppet code that is hard to debug.
[helmut@BSDHelmut ˜]$ sudo diff -q
/usr/local/etc/letsencrypt/live/www/privkey.pem
/usr/local/etc/ssl/private/www.letsencrypt.4096.key > /dev/null; echo $?
1
[helmut@BSDHelmut ˜]$
Where is the issue?
[helmut@BSDHelmut ˜]$ puppet -V
5.5.16
[helmut@BSDHelmut ˜]$
Thank you!
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/xn0lyako587brxt001%40news.gmane.org.
Hello,
The file resource also copies the file from the client, so it should work.
Of course, I do not (and/or cannot) explain why the diff fails, but by using a file resource (with a local file as a source) one simply works around this :)
-----Original message-----
From: Helmut Schneider <jump...@gmx.de>
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/xn0lyf0k2bdc0qg001%40news.gmane.org.
The certificate is on the agent system, not the master so I need to do the exec.
--