install node-exporter natively on all nodes #26
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: Apply Ansible | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install Tailscale | |
run: | | |
curl -fsSL https://tailscale.com/install.sh | sh | |
- name: Join Tailscale Network | |
run: | | |
sudo tailscale up --authkey=${{ secrets.TAILSCALE_AUTH_KEY }} | |
- name: Add private SSH key | |
run: | | |
mkdir -p ~/.ssh | |
echo "${{ secrets.PRIVATE_SSH_KEY_B64 }}" | base64 -d > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
- name: Create Vault Password File | |
run: | | |
echo "${{ secrets.VAULT_PASSWORD }}" > /tmp/vault_password.txt | |
- name: Install Ansible | |
run: | | |
sudo apt-get install -y ansible | |
- name: Install Ansible requirements | |
run: | | |
ansible-galaxy collection install -r requirements.yml | |
- name: Install jmespath because GHA is broken | |
run: | | |
sudo pipx inject ansible-core jmespath | |
- name: Run Ansible Playbook | |
run: | | |
export ANSIBLE_HOST_KEY_CHECKING=false | |
export no_proxy='*' | |
ansible-playbook -i hosts.yml -e @secrets.yml --vault-password-file /tmp/vault_password.txt site.yml |