mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-29 19:50:25 -07:00
Starting work on getting integration tests working on v2
This is incomplete work, and requires some minor tweeks to the integration tests which are not included in this commit.
This commit is contained in:
parent
d7f67ea62b
commit
2aeb79f45f
24 changed files with 189 additions and 155 deletions
|
@ -53,6 +53,7 @@ class PlaybookExecutor:
|
|||
|
||||
signal.signal(signal.SIGINT, self._cleanup)
|
||||
|
||||
result = 0
|
||||
try:
|
||||
for playbook_path in self._playbooks:
|
||||
pb = Playbook.load(playbook_path, variable_manager=self._variable_manager, loader=self._loader)
|
||||
|
@ -67,7 +68,6 @@ class PlaybookExecutor:
|
|||
new_play = play.copy()
|
||||
new_play.post_validate(all_vars, fail_on_undefined=False)
|
||||
|
||||
result = True
|
||||
for batch in self._get_serialized_batches(new_play):
|
||||
if len(batch) == 0:
|
||||
raise AnsibleError("No hosts matched the list specified in the play", obj=play._ds)
|
||||
|
@ -75,22 +75,22 @@ class PlaybookExecutor:
|
|||
self._inventory.restrict_to_hosts(batch)
|
||||
# and run it...
|
||||
result = self._tqm.run(play=play)
|
||||
if not result:
|
||||
if result != 0:
|
||||
break
|
||||
|
||||
if not result:
|
||||
if result != 0:
|
||||
# FIXME: do something here, to signify the playbook execution failed
|
||||
self._cleanup()
|
||||
return 1
|
||||
return result
|
||||
except:
|
||||
self._cleanup()
|
||||
raise
|
||||
|
||||
self._cleanup()
|
||||
return 0
|
||||
return result
|
||||
|
||||
def _cleanup(self, signum=None, framenum=None):
|
||||
self._tqm.cleanup()
|
||||
return self._tqm.cleanup()
|
||||
|
||||
def _get_serialized_batches(self, play):
|
||||
'''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue