Hi Thomas,

On Thu, Oct 22, 2015 at 1:00 AM, Thomas Müller <[email protected]>
wrote:

> Hi
>
> I know it's possible to confine a fact by other facts like "confine
> :operatingsystem => :Fedora".
>
> But i have a fact which requires a binary from a rpm package which is only
> installed by puppet. For the first puppet run tries to execute the not-yet
> installed binary and fails.
>
> is it possible to use something like this to confine based on existing
> files?
>

It is possible, as the `confine` method also takes a block:

```
Facter.add(:foo) do
  confine do
    File.exist? '/path/to/binary'
  end

  setcode do
    'bar'
  end
end
```


>
> confine File.exists?(/path/to/binary)
>
>
> Or what is the best practice for such facts which rely on things installed
> by puppet manifests?
>
> - Thomas
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/3cc22965-5c92-49da-a370-36589d6c0dc9%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/3cc22965-5c92-49da-a370-36589d6c0dc9%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CACZQQfMAx7XKQQik8qwKGGV51AKodb%3DJ%3DjKY7cvbM6nw6es%2BZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to