now use combine vars to preserve existing cached host vars

pull/10508/head
Brian Coca 10 years ago
parent c49685b753
commit d4ebe77502

@ -20,7 +20,7 @@ import ansible
from ansible.callbacks import vv from ansible.callbacks import vv
from ansible.errors import AnsibleError as ae from ansible.errors import AnsibleError as ae
from ansible.runner.return_data import ReturnData from ansible.runner.return_data import ReturnData
from ansible.utils import parse_kv from ansible.utils import parse_kv, combine_vars
from ansible.inventory.host import Host from ansible.inventory.host import Host
from ansible.inventory.group import Group from ansible.inventory.group import Group
@ -92,7 +92,7 @@ class ActionModule(object):
# actually load host vars # actually load host vars
new_host.vars = inventory.get_host_variables(new_name, update_cached=True, vault_password=inventory._vault_password) new_host.vars = combine_vars(new_host.vars, inventory.get_host_variables(new_name, update_cached=True, vault_password=inventory._vault_password))
# Add any passed variables to the new_host # Add any passed variables to the new_host
for k in args.keys(): for k in args.keys():

Loading…
Cancel
Save