dawidd6 / action-ansible-playbook

:gear: A GitHub Action for running Ansible playbooks
MIT License
306 stars 68 forks source link

vault_password not being set? #91

Closed t-readyroc closed 9 months ago

t-readyroc commented 9 months ago

Here's the invocation:

      - name: Upload ISOs to vSphere Datastore
        if: |
          (contains(github.ref_name, 'release') || contains(github.ref_name, 'develop')) &&
          inputs.FORCE_UPLOAD == true
        uses: dawidd6/action-ansible-playbook@v2
        with:
          playbook: copy_iso.yml
          directory: playbooks
          vault_password: ${{ secrets.IT_VAULT_PASSWORD }}
          requirements: requirements.yml
          options:
            --extra-vars workspace=${{ GITHUB.WORKSPACE }}

Here's the resulting run. Doesn't look like vault_password is actually getting set?

Run dawidd6/action-ansible-playbook@v2
  with:
    playbook: copy_iso.yml
    directory: playbooks
    requirements: requirements.yml
    options: --extra-vars workspace=/opt/actions-runner/_work/workflow-testing/workflow-testing
  env:
    BRANCH_REF: develop
    ARTIFACTORY_TOKEN: ***
    PARTNERS_ARTIFACTORY_TOKEN: ***
    PARTNERS_ARTIFACTORY_USER: svc-bv-jenkins
    PARTNERS_ARTIFACTORY_URL: partners.artifactory.<company>.com
    PATH: /home/admin/pyenv/versions/3.8.16/envs/devops/bin:/home/admin/.local/bin:/home/admin/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
    VIRTUAL_ENV: /home/admin/pyenv/versions/3.8.16/envs/devops
/home/admin/pyenv/versions/3.8.16/envs/devops/bin/ansible-galaxy collection install -r requirements.yml
Process install dependency map
|/-\|Starting collection install process
|Skipping 'community.vmware' as it is already installed
/home/admin/pyenv/versions/3.8.16/envs/devops/bin/ansible-playbook copy_iso.yml --extra-vars workspace=/opt/actions-runner/_work/workflow-testing/workflow-testing
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that
the implicit localhost does not match 'all'

PLAY [Copy ISOs to GREEN-VSRN01-vSAN/isos and VSRN01/ISOs] *********************

TASK [Prepare list of ISOs to copy] ********************************************
ok: [localhost]

TASK [include_tasks] ***********************************************************
included: /opt/actions-runner/_work/workflow-testing/workflow-testing/playbooks/include_iso_upload.yml for localhost
included: /opt/actions-runner/_work/workflow-testing/workflow-testing/playbooks/include_iso_upload.yml for localhost
included: /opt/actions-runner/_work/workflow-testing/workflow-testing/playbooks/include_iso_upload.yml for localhost
included: /opt/actions-runner/_work/workflow-testing/workflow-testing/playbooks/include_iso_upload.yml for localhost

TASK [Copy iso files to datastores] ********************************************
fatal: [localhost]: FAILED! => {"msg": "Attempting to decrypt but no vault secrets found"}

Am I expecting incorrect behavior for this parameter?

t-readyroc commented 9 months ago

Sorted it out - I was using the wrong var name. Sigh.