Actually if you can support the code duplication it would look like:

```
    elsif !host_and_device_resource?(resource) && resource.appliable_to_host? && for_network_device
      resource.debug "Skipping host resources because running on a device"
    elsif !host_and_device_resource?(resource) && resource.appliable_to_device? && !for_network_device
      resource.debug "Skipping device resources because running on a posix host"
...

  def host_and_device_resource?(resource)
    resource.appliable_to_host? && resource.appliable_to_device?
  end
```