see https://github.com/theforeman/foreman/blob/develop/app/helpers/hosts_helper.rb#L26-L64