diff options
| author | Jeffrey Zhang <zhang.lei.fly@gmail.com> | 2017-06-12 09:18:20 +0800 |
|---|---|---|
| committer | Jeffrey Zhang <zhang.lei.fly@gmail.com> | 2017-06-15 22:37:28 +0800 |
| commit | 03e1b05f9925007a4d4a3ee0e8136145fd884126 (patch) | |
| tree | 4f6557ed3926702903b26d734e17c50b113183da /ansible/action_plugins | |
| parent | b39e84a23bd090c0bccf3c12965948427490b430 (diff) | |
| download | kolla-ansible-03e1b05f9925007a4d4a3ee0e8136145fd884126.tar.gz kolla-ansible-03e1b05f9925007a4d4a3ee0e8136145fd884126.zip | |
Use unified vars in task
Ansible task support vars directive, no need implement another one in
merge_config. This patch remove the vars directive in merge_config
action plugin.
Change-Id: I33648a2b6e39b4d49ce76eb66fbf2522721f8c68
Diffstat (limited to 'ansible/action_plugins')
| -rw-r--r-- | ansible/action_plugins/merge_configs.py | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/ansible/action_plugins/merge_configs.py b/ansible/action_plugins/merge_configs.py index da2ab8fb6..11462f4b3 100644 --- a/ansible/action_plugins/merge_configs.py +++ b/ansible/action_plugins/merge_configs.py @@ -98,8 +98,6 @@ class ActionModule(action.ActionBase): def run(self, tmp=None, task_vars=None): - if task_vars is None: - task_vars = dict() result = super(ActionModule, self).run(tmp, task_vars) # NOTE(jeffrey4l): Ansible 2.1 add a remote_user param to the @@ -114,22 +112,15 @@ class ActionModule(action.ActionBase): tmp = self._make_tmp_path(remote_user) sources = self._task.args.get('sources', None) - extra_vars = self._task.args.get('vars', list()) if not isinstance(sources, list): sources = [sources] - temp_vars = task_vars.copy() - temp_vars.update(extra_vars) - config = OverrideConfigParser() - old_vars = self._templar._available_variables - self._templar.set_available_variables(temp_vars) for source in sources: self.read_config(source, config) - self._templar.set_available_variables(old_vars) # Dump configparser to string via an emulated file fakefile = StringIO() @@ -140,7 +131,6 @@ class ActionModule(action.ActionBase): fakefile.close() new_module_args = self._task.args.copy() - new_module_args.pop('vars', None) new_module_args.pop('sources', None) new_module_args.update( |
