'Read a vault password from a file or if executable, execute the script and
retrieve password from STDOUT'

def _read_file(self, filename):

    try:
        f = open(filename, 'rb')
        vault_pass = f.read().strip()
        f.close()
    except (OSError, IOError) as e:
        raise AnsibleError(('Could    not    read    vault    password    file    %s:    %s' % (filename, e)))
    return vault_pass
