1

I obtain an error when I use vault file in GitHub Action.

I checked my vault file, yet it seems valid. The playbook works locally, but not with the CI of github Action

Error in vault password file loading (default): Vault envelope
format error: list index out of range

Here, my Ansible executed code :

- name: Run playbook
  uses: dawidd6/action-ansible-playbook@v2
  with:
    # Required, playbook filepath
    playbook: ansible/playbook.yml
    # Optional, directory where playbooks live
    directory: ./
    # Optional, SSH private key
    key: $SSH_KEY
    # Optional, literal inventory file contents
    inventory: ansible/hosts.ini
    # Optional, SSH known hosts file content
    known_hosts: .known_hosts
    # Optional, encrypted vault password
    vault_password: $ANSIBLE_VAULT_PASSWORD
    # Optional, galaxy requirements filepath
    #requirements: galaxy-requirements.yml
    # Optional, additional flags to pass to ansible-playbook
    options: |
      --verbose

No playbook task starts, ansible cannot start the playbook, because it cannot decipher the password vault (This password is stored in the secrets of the github repository)

Laurel
  • 5,965
  • 14
  • 31
  • 57
Sacha Durand
  • 473
  • 1
  • 5
  • 11

0 Answers0