Deploy OVPN server #17
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 OVPN server | |
on: | |
workflow_dispatch: | |
inputs: | |
server_ip: | |
description: Server IP | |
required: true | |
type: string | |
client_tag: | |
description: Client tag | |
required: true | |
type: string | |
jobs: | |
setup-runner: | |
runs-on: ubuntu-latest | |
name: Setup runner | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
- name: Install runner dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r runner-packages.txt | |
deploy-ovpn: | |
runs-on: ubuntu-latest | |
name: Deploy OpenVPN server | |
needs: [setup-runner] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Configure Ansible | |
run: | | |
echo "ANSIBLE_CONFIG=ansible.cfg" >> $GITHUB_ENV | |
- name: Run playbook | |
run: | | |
ansible-playbook playbook.yml -i ${{ inputs.server_ip }}, -e ansible_user=root -e ansible_ssh_pass=${{ secrets.SSH_PASS }} -e client_tag=${{ inputs.client_tag }} -e tg_bot_token=${{ secrets.TG_BOT_TOKEN }} -e tg_chat_id=${{ secrets.TG_CHAT_ID }} -vv |