refactored hosts file methods into tasks

created add_hosts and remove_hosts tasks which call the helper methods directly.

call execute tasks inline where the methods were called