Skip to content

Commit

Permalink
Improved inventory handling when inventory does not yet exist
Browse files Browse the repository at this point in the history
Fixes ansible#8324
Improves ansible#7667
  • Loading branch information
willthames authored and Michael DeHaan committed Aug 22, 2014
1 parent b0e863b commit 1787c29
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/ansible-pull
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import time
from ansible import utils
from ansible.utils import cmd_functions
from ansible import errors
from ansible import inventory

DEFAULT_REPO_TYPE = 'git'
DEFAULT_PLAYBOOK = 'local.yml'
Expand Down Expand Up @@ -150,7 +151,9 @@ def main(args):
now = datetime.datetime.now()
print >>sys.stderr, now.strftime("Starting ansible-pull at %F %T")

if not options.inventory:
# Attempt to use the inventory passed in as an argument
# It might not yet have been downloaded so use localhost if note
if not options.inventory or not os.path.exists(options.inventory):
inv_opts = 'localhost,'
else:
inv_opts = options.inventory
Expand Down

0 comments on commit 1787c29

Please sign in to comment.