Commit 670894e2 by Matt Martz

Move building the play_ds into a method, that can be overridden

parent 0d606b57
......@@ -65,6 +65,13 @@ class AdHocCLI(CLI):
return True
def _play_ds(self, pattern):
return dict(
name = "Ansible Ad-Hoc",
hosts = pattern,
gather_facts = 'no',
tasks = [ dict(action=dict(module=self.options.module_name, args=parse_kv(self.options.module_args))), ]
)
def run(self):
''' use Runner lib to do SSH things '''
......@@ -117,13 +124,7 @@ class AdHocCLI(CLI):
# results = runner.run()
# create a pseudo-play to execute the specified module via a single task
play_ds = dict(
name = "Ansible Ad-Hoc",
hosts = pattern,
gather_facts = 'no',
tasks = [ dict(action=dict(module=self.options.module_name, args=parse_kv(self.options.module_args))), ]
)
play_ds = self._play_ds(pattern)
play = Play().load(play_ds, variable_manager=variable_manager, loader=loader)
# now create a task queue manager to execute the play
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment