import_playbook is not usable from inside a play

(cherry picked from commit 55dddf530ad094810929823f80c4546e97a69ac7)
pull/43231/head
Brian Coca 6 years ago committed by Brian Coca
parent a7097f6735
commit 917b6b0d09

@ -134,6 +134,10 @@ class AdHocCLI(CLI):
err = err + ' (did you mean to run ansible-playbook?)' err = err + ' (did you mean to run ansible-playbook?)'
raise AnsibleOptionsError(err) raise AnsibleOptionsError(err)
# Avoid modules that don't work with ad-hoc
if self.options.module_name in ('import_playbook',):
raise AnsibleOptionsError("'%s' is not a valid action for ad-hoc commands" % self.options.module_name)
play_ds = self._play_ds(pattern, self.options.seconds, self.options.poll_interval) play_ds = self._play_ds(pattern, self.options.seconds, self.options.poll_interval)
play = Play().load(play_ds, variable_manager=variable_manager, loader=loader) play = Play().load(play_ds, variable_manager=variable_manager, loader=loader)

Loading…
Cancel
Save