Exclude search in template if the attribute is empty

Do not include search in the template if the attribute is empty. There are times where I have a VM with no domain and having a blank search line in resolv.conf breaks functionality.