mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
preserve same order as inventory manager when using host lookup (#55331)
* preserve same order as inventory manager when using inventory_hostnames lookup add a test * move generic code
This commit is contained in:
committed by
Brian Coca
parent
0330ea616e
commit
afb5e02c19
@@ -36,6 +36,7 @@ RETURN = """
|
||||
|
||||
from ansible.inventory.manager import split_host_pattern, order_patterns
|
||||
from ansible.plugins.lookup import LookupBase
|
||||
from ansible.utils.helpers import deduplicate_list
|
||||
|
||||
|
||||
class LookupModule(LookupBase):
|
||||
@@ -70,4 +71,4 @@ class LookupModule(LookupBase):
|
||||
host_list.extend(that)
|
||||
|
||||
# return unique list
|
||||
return list(set(host_list))
|
||||
return deduplicate_list(host_list)
|
||||
|
||||
Reference in New Issue
Block a user