Deploy to Latitude #27
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Lightclients | |
on: | |
push: | |
jobs: | |
ansible: | |
runs-on: ubuntu-latest | |
env: | |
NETWORK: turing | |
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY}} | |
SERVER_COUNT: 20 | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Virtual Environment | |
working-directory: ansible | |
run: | | |
echo "${{ secrets.SSH_KEY }}" >> key && chmod 0600 key && ls -ltr . | |
source /opt/pipx/venvs/ansible-core/bin/activate | |
which python | |
which ansible | |
cat key | |
- name: view ansible inventory | |
working-directory: ansible | |
run: ansible-inventory --inventory inventory/${{ env.NETWORK }}.ini --list | |
- name: ping all | |
working-directory: ansible | |
run: ansible all -m ping --inventory inventory/${{ env.NETWORK }}.ini --extra-vars "@${{ env.NETWORK }}-vars.yml" -vvv | |
- name: run playbook | |
working-directory: ansible | |
run: ansible-playbook playbook.yml --extra-vars "@${{ env.NETWORK }}-vars.yml" | |
- name: Setup upterm session | |
uses: lhotari/action-upterm@v1 | |
if: ${{ failure() }} | |
with: | |
wait-timeout-minutes: 2 | |
# TODO: test that datadog api keys undefined fails |