mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 11:51:26 -07:00
This function is for setting variables on hosts. So those two parts are always required.
Don't have to check for the existence of those in the function. If they aren't set to iterables then it should be up to the calling code to handle it.
This commit is contained in:
parent
b4a58b65fb
commit
e986e31a75
1 changed files with 4 additions and 7 deletions
|
@ -74,11 +74,8 @@ class BaseInventoryPlugin(object):
|
|||
pass
|
||||
|
||||
def populate_host_vars(self, hosts, variables, group=None, port=None):
|
||||
|
||||
if hosts:
|
||||
for host in hosts:
|
||||
self.inventory.add_host(host, group=group, port=port)
|
||||
if variables:
|
||||
for k in variables:
|
||||
self.inventory.set_variable(host, k, variables[k])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue