I want to accomplish something like:
```
exec { 'a_name':
command => '/path/to/my/script.sh',
provider => 'shell',
onlyif => '/path/to/my/test_script.sh',
}
```
My problem is in `onlyif` part - I cannot use `return` in test_script.sh to return true/false. (Or can I?)
If I want to use `return` in shell, I must create a function, so I've created a function `test_fun()` which resides in test_script.sh. But the next question is how can I call `test_fun()` from `onlyif`? First I've tried something like:
```
onlyif => 'source /path/to/my/test_script.sh; test_fun'
```
But I've got `unknown command source` (or something similar). Then I've tried with:
```
onlyif => '. /path/to/my/test_script.sh; test_fun'
```
(dot instead of `source`), and it kinda executes (no error), but what actually happened is that test_fun wasn't been called at all.
Thanks!
↧