On Mon, Jan 31, 2011 at 15:31, Ashley Gould <ago...@ucop.edu> wrote: > On Mon, Jan 31, 2011 at 02:14:29PM -0800, jcbollinger wrote: >> On Jan 31, 3:12 pm, Ashley Gould <ago...@ucop.edu> wrote: >> >> > if [ "/usr/bin/my_harmless_binary 2>&1 >/dev/null" ]; then >> > echo "my_harmless_binary succeeded" >> > cp /tmp/file1 /data/ >> > else >> > echo "my_harmless_binary FAILED" >> > fi
[...] > thank you both. my current task will use a file action. I'm trying > to make puppet chose between alturnative versions of a file based on > the result of a binary. > > I will work on the custom fact idea. if such an issue is coming at > me so early in the game, then I may as well get started learning > how to build facts. For what it is worth, I would say that the reason you are running into this so early in the process is that you are not yet using puppet the way it expects to be used – and, so, you run into these complications. In the puppet model you would not ask the system about that binary, then do something: you would say "machine A should have the binary, and the something, while machine B should not have either". The idea is that you declare, as far as possible, the state your system should be – not what calculations you make to get from the current to the desired state. Fact should, ideally, be things about the system that don't vary (memory size, disk space) with state changes, not questions about the current state. So, I would strongly encourage you to "answer" the question about that binary by deciding if the machine should have it installed, and if it should work, and then implementing *that* in puppet. The file install bit should just fall into line after that. Regards, Daniel -- ⎋ Puppet Labs Developer – http://puppetlabs.com ✉ Daniel Pittman <dan...@puppetlabs.com> ✆ Contact me via gtalk, email, or phone: +1 (877) 575-9775 ♲ Made with 100 percent post-consumer electrons -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.