On 17.06.2010 14:30, David Schmitt wrote:
On 6/17/2010 1:02 PM, Silviu Paragina wrote:
On 17.06.2010 10:53, David Schmitt wrote:
On 6/16/2010 8:27 PM, Silviu Paragina wrote:
This is somewhat related to an older thread. The topic was how to
install some perquisite packages for puppet, like augeas, lsb-release,
cron to name just a few. Puppet is required to reinstall this packages
if they are accidentally uninstalled. Because of the nature of this
packages some puppet code should not run in this state.

/For example/ if lsb-release isn't installed, and clients are both
ubuntu and debian, the apt package shouldn't setup sources as it might
end up switching the distro. (if lsb-release isn't installed facter can
not distinguish debian from ubuntu)
Augeas resources if are included in the run end up failing the run, thus
not allowing augeas to be installed.

The following case will fail, is lsb-release is not installed:

case $lsbdistcodename {
"lenny": {...}
"lucid": {...}
}

Wouldn't that be enough?

Best Regards, David
Interesting ideea. That should actually do for lsb-release, but how
about for augeas/cron. (I have a similar fact for augeas)
My ideea was to disable any sensitive puppet code in case of some sanity
checks failing.

The types should fail if no provider can be found. This in turn should fail all depending resources (e.g. require => Augeas[...] ). Can you provide a specific example?


Best Regards, David

I've been left with the impression that if augeas fails for provider reasons it fails the whole run.

My test case would imply the same thing.

sil...@puppet-test:/etc/puppet/repo/development/modules/puppet$ cat test.pp
augeas
{ "puppet settings":
        context => "/files/etc/puppet/puppet.conf",
        changes => [  "set main/report true",
                "set main/server puppet.paragina.ro",],
}


exec
{ "/test.sh":
}
sil...@puppet-test:/etc/puppet/repo/development/modules/puppet$ cat /test.sh
#!/bin/sh

date >> /touchme
exit 1
sil...@puppet-test:/etc/puppet/repo/development/modules/puppet$ sudo puppet test.pp \
>
warning: Could not retrieve fact fqdn
Could not find a default provider for augeas
sil...@puppet-test:/etc/puppet/repo/development/modules/puppet$ ls /touchme
ls: cannot access /touchme: No such file or directory

There is no dependency between them yet the exec resource wasn't applied. If I remember right, the issue with this was that the run failed without installing augeas and the machine would be left in a ever failing state.


Silviu




--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to