-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (50 loc) · 1.74 KB
/
test-uname.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# This is a quick way to test that ansible has all the access it needs to a given set of inventory hosts.
name: Test access to all machines
on:
workflow_dispatch:
inputs:
network:
description: "Network:"
default: "butterflynet"
type: choice
options:
- butterflynet
dry-run:
description: "Dry-run changes?"
type: boolean
default: true
jobs:
upgrade:
runs-on: [ self-hosted, linux, x64, 2xlarge ]
timeout-minutes: 10
env:
NETWORK: ${{ inputs.network || 'butterflynet'}}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Lotus Ansible Prepare
uses: ./.github/actions/lotus-ansible-prepare
with:
branch: "main"
PRIVATE_SSH_KEY: ${{ secrets.PRIVATE_SSH_KEY }}
EC2_SSH_KEY: ${{ secrets.EC2_SSH_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: "us-east-1"
ANSIBLE_VAULT_PASSWORD: ${{ secrets.ANSIBLE_VAULT_PASSWORD }}
- name: Run uname -a on all machines
shell: bash
working-directory: ansible
env:
DRY_RUN_FLAG: ${{ inputs.dry-run && '--check' || '' }}
run: |
# Infer deploy network from network name to reduce unnecessary noise in actions inputs.
DEPLOY_NETWORK=$(
case ${{ env.NETWORK }} in
butterflynet) printf 'butterfly.fildev.network' ;;
*) echo 'Unknown network: ${{ env.NETWORK }}' >&2; exit 1 ;;
esac
)
ansible-playbook -i inventories/${DEPLOY_NETWORK}/hosts.yml \
${{ env.DRY_RUN_FLAG }} \
test-uname.yml