mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
config: use path list for default inventory
This allows to use a pathlist in the ansible.cfg: [default] inventory = path/inventory:other_path/inventory Since ansible allows to use --inventory on CLI more then once, we should also support a pathlist in the config.
This commit is contained in:
parent
f4fff54f68
commit
da488a8db5
2 changed files with 2 additions and 4 deletions
|
@ -596,9 +596,7 @@ class CLI(with_metaclass(ABCMeta, object)):
|
||||||
self.options.inventory = [unfrackpath(opt) if ',' not in opt else opt for opt in self.options.inventory]
|
self.options.inventory = [unfrackpath(opt) if ',' not in opt else opt for opt in self.options.inventory]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# set default if it exists
|
self.options.inventory = C.DEFAULT_HOST_LIST
|
||||||
if os.path.exists(C.DEFAULT_HOST_LIST):
|
|
||||||
self.options.inventory = [C.DEFAULT_HOST_LIST]
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def version(prog):
|
def version(prog):
|
||||||
|
|
|
@ -604,7 +604,7 @@ DEFAULT_HOST_LIST:
|
||||||
expand_relative_paths: True
|
expand_relative_paths: True
|
||||||
ini:
|
ini:
|
||||||
- {key: inventory, section: defaults}
|
- {key: inventory, section: defaults}
|
||||||
type: path
|
type: pathlist
|
||||||
yaml: {key: defaults.inventory}
|
yaml: {key: defaults.inventory}
|
||||||
DEFAULT_INTERNAL_POLL_INTERVAL:
|
DEFAULT_INTERNAL_POLL_INTERVAL:
|
||||||
default: 0.001
|
default: 0.001
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue