##### SUMMARY
Since `add_host` and `group_by` actions only modify the runtime inventory, hosts/groups/vars added by them don't survive a `meta: refresh_inventory` call (since that call completely clears the runtime inventory). 

##### ISSUE TYPE
- Feature Idea

##### COMPONENT NAME
InventoryManager

##### ADDITIONAL INFORMATION
After some internal discussion, the general consensus seemed to be that this behavior is an undesirable default. The `add_host` and `group_by` actions should manage a more persistent state independent of the runtime inventory, then apply their changes to the running inventory. When a `meta: refresh_inventory` occurs, the normal dynamic inventory clear/refresh should happen, then reapply the add_host/group_by state. This should probably be the default behavior, but a config switch or a different `meta` action (or an arg to it) to emulate the current behavior could also be created if necessary.

"""
        Takes a list of patterns and returns a list of matching host names,
        taking into account any negative and intersection patterns.
        """
        patterns = order_patterns(patterns)
        hosts = []
        for p in patterns:
            
            if p in self._inventory.hosts:
                hosts.append(self._inventory.get_host(p))
            else:
                that = self._match_one_pattern(p)
                if p[0] == "!":
                    that = set(that)
                    hosts = [h for h in hosts if h not in that]
                elif p[0] == "&":
                    that = set(that)
                    hosts = [h for h in hosts if h in that]
                else:
                    existing_hosts = set(y.name for y in hosts)
                    hosts.extend([h for h in that if h.name not in existing_hosts])
        return hosts
    def _match_one_pattern(self, pattern):