diff options
author | Will Thames <will@thames.id.au> | 2014-08-01 07:58:00 +0200 |
---|---|---|
committer | Michael DeHaan <michael@ansible.com> | 2014-08-22 20:49:09 +0200 |
commit | 1787c293546b4c8ea2c3418356b3fdabff44edaa (patch) | |
tree | 1590fbc6a6d279589d34a3eeadbdc3c277612615 | |
parent | Merge pull request #8659 from willthames/rds_module_connection_fix (diff) | |
download | ansible-1787c293546b4c8ea2c3418356b3fdabff44edaa.tar.xz ansible-1787c293546b4c8ea2c3418356b3fdabff44edaa.zip |
Improved inventory handling when inventory does not yet exist
Fixes #8324
Improves #7667
-rwxr-xr-x | bin/ansible-pull | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/ansible-pull b/bin/ansible-pull index 7e3de3aeb8..4f4da24d83 100755 --- a/bin/ansible-pull +++ b/bin/ansible-pull @@ -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' @@ -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 |