We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0e863b commit 1787c29Copy full SHA for 1787c29
bin/ansible-pull
@@ -49,6 +49,7 @@ import time
49
from ansible import utils
50
from ansible.utils import cmd_functions
51
from ansible import errors
52
+from ansible import inventory
53
54
DEFAULT_REPO_TYPE = 'git'
55
DEFAULT_PLAYBOOK = 'local.yml'
@@ -150,7 +151,9 @@ def main(args):
150
151
now = datetime.datetime.now()
152
print >>sys.stderr, now.strftime("Starting ansible-pull at %F %T")
153
- if not options.inventory:
154
+ # Attempt to use the inventory passed in as an argument
155
+ # It might not yet have been downloaded so use localhost if note
156
+ if not options.inventory or not os.path.exists(options.inventory):
157
inv_opts = 'localhost,'
158
else:
159
inv_opts = options.inventory
0 commit comments