summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cammarata <jimi@sngx.net>2015-10-30 09:46:09 -0400
committerJames Cammarata <jimi@sngx.net>2015-10-30 09:46:09 -0400
commitc61499168e27405be9cc751a52f4670b29d5c8fb (patch)
treea850d06bf7cc11f4f4ffd267c7a4cd95061dafe9
parent56e5e72aaa6f15d7f9de9b8ca95fc61b84f6451e (diff)
parent237f8c9df79b63d3c28672f533e4b7211874ad3f (diff)
downloadansible-c61499168e27405be9cc751a52f4670b29d5c8fb.tar.gz
Merge pull request #12962 from bcoca/pull_fixes
fixes options for ansible pull
-rw-r--r--docs/man/man1/ansible-pull.1.asciidoc.in2
-rw-r--r--lib/ansible/cli/pull.py9
2 files changed, 4 insertions, 7 deletions
diff --git a/docs/man/man1/ansible-pull.1.asciidoc.in b/docs/man/man1/ansible-pull.1.asciidoc.in
index bc7de64ada..333b8e34e0 100644
--- a/docs/man/man1/ansible-pull.1.asciidoc.in
+++ b/docs/man/man1/ansible-pull.1.asciidoc.in
@@ -13,7 +13,7 @@ ansible-pull - pull playbooks from VCS server and run them using this machine as
SYNOPSIS
--------
-ansible-pull -d DEST -U URL [options] [ <filename.yml> ]
+ansible-pull -U URL [options] [ <filename.yml> ]
DESCRIPTION
diff --git a/lib/ansible/cli/pull.py b/lib/ansible/cli/pull.py
index 6caa8525db..c163b3ef0b 100644
--- a/lib/ansible/cli/pull.py
+++ b/lib/ansible/cli/pull.py
@@ -50,7 +50,7 @@ class PullCLI(CLI):
''' create an options parser for bin/ansible '''
self.parser = CLI.base_parser(
- usage='%prog <host-pattern> [options]',
+ usage='%prog -U <repository> [options]',
connect_opts=True,
vault_opts=True,
runtask_opts=True,
@@ -67,7 +67,7 @@ class PullCLI(CLI):
help='sleep for random interval (between 0 and n number of seconds) before starting. This is a useful way to disperse git requests')
self.parser.add_option('-f', '--force', dest='force', default=False, action='store_true',
help='run the playbook even if the repository could not be updated')
- self.parser.add_option('-d', '--directory', dest='dest', default=None, help='directory to checkout repository to')
+ self.parser.add_option('-d', '--directory', dest='dest', default='~/.ansible/pull', help='directory to checkout repository to')
self.parser.add_option('-U', '--url', dest='url', default=None, help='URL of the playbook repository')
self.parser.add_option('-C', '--checkout', dest='checkout',
help='branch/tag/commit to checkout. ' 'Defaults to behavior of repository module.')
@@ -91,9 +91,6 @@ class PullCLI(CLI):
if not self.options.url:
raise AnsibleOptionsError("URL for repository not specified, use -h for help")
- if len(self.args) != 1:
- raise AnsibleOptionsError("Missing target hosts")
-
if self.options.module_name not in self.SUPPORTED_REPO_MODULES:
raise AnsibleOptionsError("Unsuported repo module %s, choices are %s" % (self.options.module_name, ','.join(self.SUPPORTED_REPO_MODULES)))
@@ -114,7 +111,7 @@ class PullCLI(CLI):
# Now construct the ansible command
node = platform.node()
host = socket.getfqdn()
- limit_opts = 'localhost:%s:127.0.0.1' % ':'.join(set([host, node, host.split('.')[0], node.split('.')[0]]))
+ limit_opts = 'localhost,%s,127.0.0.1' % ','.join(set([host, node, host.split('.')[0], node.split('.')[0]]))
base_opts = '-c local "%s"' % limit_opts
if self.options.verbosity > 0:
base_opts += ' -%s' % ''.join([ "v" for x in range(0, self.options.verbosity) ])