summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Coca <brian.coca+git@gmail.com>2015-12-03 19:42:05 -0800
committerBrian Coca <brian.coca+git@gmail.com>2015-12-03 19:44:31 -0800
commit46718ac3f49dde4deb1b32e088578d270a0fc907 (patch)
treee423e7eb8b1261fd5fe177ac7f64ffcd628b1d6a
parent3e5c7c540be301529133b5e02a392e0f08ee0d65 (diff)
downloadansible-46718ac3f49dde4deb1b32e088578d270a0fc907.tar.gz
reverted to previous pull checkout dir behaviour
This fixes bugs with not finding plays when not specifying checkout dir Also makes it backwards compatible
-rw-r--r--lib/ansible/cli/pull.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ansible/cli/pull.py b/lib/ansible/cli/pull.py
index 9cc6c25e9f..b2e402126d 100644
--- a/lib/ansible/cli/pull.py
+++ b/lib/ansible/cli/pull.py
@@ -74,7 +74,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='~/.ansible/pull',
+ self.parser.add_option('-d', '--directory', dest='dest', default=None,
help='directory to checkout repository to')
self.parser.add_option('-U', '--url', dest='url', default=None,
help='URL of the playbook repository')
@@ -90,6 +90,11 @@ class PullCLI(CLI):
self.options, self.args = self.parser.parse_args()
+ if not self.options.dest:
+ hostname = socket.getfqdn()
+ # use a hostname dependent directory, in case of $HOME on nfs
+ self.options.dest = os.path.join('~/.ansible/pull', hostname)
+
if self.options.sleep:
try:
secs = random.randint(0,int(self.options.sleep))