Update Ansible Workflows

This commit is contained in:
AngrySoundTech
2024-04-16 13:24:47 -04:00
parent eb4ea5aa88
commit 84eaa92163
8 changed files with 37 additions and 31 deletions

View File

@@ -0,0 +1,38 @@
name: 🏗️ Ansible | Stop Server
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to Stop'
type: environment
required: true
default: Test
defaults:
run:
working-directory: ./ansible
jobs:
stop-server:
runs-on: ubuntu-latest
environment: ${{inputs.environment}}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Inject secrets
run: 'echo "$SECRETS_YML" > variables/secrets.yml'
shell: bash
env:
SECRETS_YML: ${{secrets.SECRETS_YML}}
SUDO_PASSWORD: ${{secrets.SUDO_PASSWORD}}
- name: Stop Server
uses: dawidd6/action-ansible-playbook@v2
with:
playbook: playbooks/stop-server.yml
requirements: requirements.yml
key: ${{secrets.SSH_PRIVATE_KEY}}
known_hosts: ${{secrets.SSH_KNOWN_HOSTS}}
options: |
--inventory ./inventories/civmc-${{inputs.environment}}.yml
-e "ansible_become_password=${{secrets.SUDO_PASSWORD}}"