So simply change this, than we are sure that it is always a boolean value:

```ruby
(@node.nil? or @role.nil?) ? false : !!self.crowbar["crowbar"]["allocated"]
```