|
|
@ -32,8 +32,9 @@
|
|
|
|
# for playbooks in the following order, stopping at the first match:
|
|
|
|
# for playbooks in the following order, stopping at the first match:
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# 1. $workdir/path/playbook.yml, if specified
|
|
|
|
# 1. $workdir/path/playbook.yml, if specified
|
|
|
|
# 2. $workdir/$hostname.yml
|
|
|
|
# 2. $workdir/$fqdn.yml
|
|
|
|
# 3. $workdir/local.yml
|
|
|
|
# 3. $workdir/$hostname.yml
|
|
|
|
|
|
|
|
# 4. $workdir/local.yml
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# the source repo must contain at least one of these playbooks.
|
|
|
|
# the source repo must contain at least one of these playbooks.
|
|
|
|
|
|
|
|
|
|
|
@ -80,10 +81,12 @@ def select_playbook(path, args):
|
|
|
|
return None
|
|
|
|
return None
|
|
|
|
return playbook
|
|
|
|
return playbook
|
|
|
|
else:
|
|
|
|
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)
|
|
|
|
localpb = "%s/%s" % (path, DEFAULT_PLAYBOOK)
|
|
|
|
errors = []
|
|
|
|
errors = []
|
|
|
|
for pb in [hostpb, localpb]:
|
|
|
|
for pb in [hostpb, shorthostpb, localpb]:
|
|
|
|
rc = try_playbook(pb)
|
|
|
|
rc = try_playbook(pb)
|
|
|
|
if rc == 0:
|
|
|
|
if rc == 0:
|
|
|
|
playbook = pb
|
|
|
|
playbook = pb
|
|
|
|