mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Ignore port numbers in simple inventory format
This commit is contained in:
parent
746f1b92ae
commit
f04041b37d
2 changed files with 4 additions and 1 deletions
|
@ -105,6 +105,9 @@ class Inventory(object):
|
||||||
groups[group_name] = []
|
groups[group_name] = []
|
||||||
elif item != "":
|
elif item != "":
|
||||||
# looks like a regular host
|
# looks like a regular host
|
||||||
|
if ":" in item:
|
||||||
|
# a port was specified
|
||||||
|
item, port = item.split(":")
|
||||||
groups[group_name].append(item)
|
groups[group_name].append(item)
|
||||||
if not item in results:
|
if not item in results:
|
||||||
results.append(item)
|
results.append(item)
|
||||||
|
|
|
@ -3,7 +3,7 @@ saturn
|
||||||
|
|
||||||
[greek]
|
[greek]
|
||||||
zeus
|
zeus
|
||||||
hera
|
hera:3000
|
||||||
poseidon
|
poseidon
|
||||||
|
|
||||||
[norse]
|
[norse]
|
||||||
|
|
Loading…
Reference in a new issue