dawidd6 / action-ansible-playbook

:gear: A GitHub Action for running Ansible playbooks
MIT License
298 stars 66 forks source link

ansible-playbook not found on private runner #74

Closed slaurijssen closed 1 year ago

slaurijssen commented 1 year ago

Trying to run a playbook on a private runner to update an internal cluster

  build:
    name: Run free_disk_space
    runs-on: self-hosted
    steps:
     - name: checkout repo content
       uses: actions/checkout@v3 # checkout the repository content    
     - name: Run playbook
       uses: dawidd6/action-ansible-playbook@v2
       with:
        playbook: all_vms/free_disk_space.yml
        key: ${{secrets.ANSIBLE_KEY}}
     - name: ls
       if: always()
       run: ls -la /opt/pipx_bin

But self-hosted runner gets the error that ansible-playbook cant be found or is not executable.

runs-on: ubuntu-latest works but then the servers cant be accessed. There it is found in /opt/pipx_bin but that does not exist on self-hosted.

So where is the ansible-playbook normally or how to get it running on a private runner?

edit I just realized this action does not actually install ansible itself like the kubectl gh action does. so the solution is to first install ansible.

dawidd6 commented 1 year ago

Yes, follow Ansible instructions on how to install it first for your Operating System.

https://github.com/dawidd6/action-ansible-playbook/blob/9c825aa4d5c39496e71448bb7ae16a71f5fc75e1/README.md?plain=1#L5