mirror of
https://github.com/CivMC/Civ.git
synced 2026-07-18 00:20:44 +00:00
Update Ansible Workflows
This commit is contained in:
38
.github/workflows/ansible_stop_server.yml
vendored
Normal file
38
.github/workflows/ansible_stop_server.yml
vendored
Normal 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}}"
|
||||
Reference in New Issue
Block a user