AC-1060 Add API support for vault password.

This commit is contained in:
Chris Church
2014-03-25 22:54:14 -04:00
parent 8ad72426b4
commit ac0927f430
6 changed files with 99 additions and 11 deletions

View File

@@ -176,9 +176,13 @@ class ProjectOptions(models.Model):
# show up.
matched = False
try:
for line in file(playbook):
for n, line in enumerate(file(playbook)):
if valid_re.match(line):
matched = True
# Any YAML file can also be encrypted with vault;
# allow these to be used as the main playbook.
elif n == 0 and line.startswith('$ANSIBLE_VAULT;'):
matched = True
except IOError:
continue
if not matched: