summaryrefslogtreecommitdiff
path: root/bin/ansible-pull
diff options
context:
space:
mode:
authorjctanner <tanner.jc@gmail.com>2013-11-14 05:32:47 -0800
committerjctanner <tanner.jc@gmail.com>2013-11-14 05:32:47 -0800
commit2d9087b806b73ab276fc96e4a431e4f759f98910 (patch)
tree5f40aaf25aefa6f4b9684d6834d04d6c4f05279a /bin/ansible-pull
parent4707e3a472da6cc077b6c0995c7ec14a52c021e6 (diff)
parent92147aff0ff1c886eea2cfb48007fd1c41e46871 (diff)
downloadansible-2d9087b806b73ab276fc96e4a431e4f759f98910.tar.gz
Merge pull request #4484 from mscherer/add_short_hostname
ansible-pull by default will look for local.yml and $fqdn.yml.
Diffstat (limited to 'bin/ansible-pull')
-rwxr-xr-xbin/ansible-pull11
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/ansible-pull b/bin/ansible-pull
index 4dd8497c7d..78f4d216e3 100755
--- a/bin/ansible-pull
+++ b/bin/ansible-pull
@@ -32,8 +32,9 @@
# for playbooks in the following order, stopping at the first match:
#
# 1. $workdir/path/playbook.yml, if specified
-# 2. $workdir/$hostname.yml
-# 3. $workdir/local.yml
+# 2. $workdir/$fqdn.yml
+# 3. $workdir/$hostname.yml
+# 4. $workdir/local.yml
#
# the source repo must contain at least one of these playbooks.
@@ -80,10 +81,12 @@ def select_playbook(path, args):
return None
return playbook
else:
- hostpb = "%s/%s.yml" % (path, socket.getfqdn())
+ fqdn = socket.getfqdn()
+ hostpb = "%s/%s.yml" % (path, fqdn)
+ shorthostpb = "%s/%s.yml" % (path, fqdn.split('.')[0])
localpb = "%s/%s" % (path, DEFAULT_PLAYBOOK)
errors = []
- for pb in [hostpb, localpb]:
+ for pb in [hostpb, shorthostpb, localpb]:
rc = try_playbook(pb)
if rc == 0:
playbook = pb