mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Annotate more files, fix missing imports messing with playbooks. Hey Tim, please test your stuff :)
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
import ansible.runner
|
||||
import ansible.constants as C
|
||||
from ansible.utils import *
|
||||
from ansible.errors import *
|
||||
import yaml
|
||||
import shlex
|
||||
import os
|
||||
@@ -87,6 +88,8 @@ class PlayBook(object):
|
||||
|
||||
def _get_vars(self, play, dirname):
|
||||
vars = play.get('vars', {})
|
||||
if type(vars) != dict:
|
||||
raise AnsibleError("'vars' section must contain only key/value pairs")
|
||||
vars_files = play.get('vars_files', [])
|
||||
for f in vars_files:
|
||||
path = path_dwim(dirname, f)
|
||||
|
||||
@@ -429,7 +429,10 @@ class Runner(object):
|
||||
# find hosts that match the pattern
|
||||
hosts = self.match_hosts(self.pattern)
|
||||
if len(hosts) == 0:
|
||||
return None
|
||||
return {
|
||||
'contacted' : {},
|
||||
'dark' : {}
|
||||
}
|
||||
|
||||
# attack pool of hosts in N forks
|
||||
# _executor_hook does all of the work
|
||||
|
||||
Reference in New Issue
Block a user