-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (68 loc) · 2.63 KB
/
configure-rhel8-equinix.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Configure RHEL 8 Equinix Server
on:
workflow_dispatch:
inputs:
hostname:
description: 'hostname'
required: true
default: hostname
target_server:
description: 'target_server'
required: true
default: rhel8-equinix
forwarder:
description: 'forwarder'
required: true
default: 1.1.1.1
domain:
description: 'domain'
required: true
default: example.com
env:
TARGET_SERVER: ${{ inputs.target_server }}
DOMAIN: ${{ inputs.domain }}
FORWARDER: ${{ inputs.forwarder }}
ACTIVE_BRIDGE: 'false'
INTERFACE: 'bond0'
jobs:
configure-rhel8-equinix:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Configure RHEL 8 Equinix Server
uses: appleboy/[email protected]
with:
host: ${{ inputs.hostname }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
command_timeout: 30m
script: |
sudo yum install -y git
if [ -d "/opt/quibinode_navigator" ]; then
cd /opt/quibinode_navigator
git config --global --add safe.directory /opt/quibinode_navigator
git config pull.rebase false
git pull
else
cd /opt/
sudo usermod -aG users ${{ secrets.USERNAME }}
sudo chown -R root:users /opt
sudo chmod -R g+w /opt
git clone https://github.com/tosin2013/quibinode_navigator.git
fi
echo "export CICD_PIPELINE=true" > /opt/quibinode_navigator/.env
echo "export SSH_PASSWORD=${{ secrets.SSH_PASSWORD }}" >> /opt/quibinode_navigator/.env
echo "export INVENTORY='${{ env.TARGET_SERVER }}'" >> /opt/quibinode_navigator/.env
echo "export ENV_USERNAME=${{ secrets.USERNAME }}" >> /opt/quibinode_navigator/.env
echo "export DOMAIN=${{ env.DOMAIN }}" >> /opt/quibinode_navigator/.env
echo "export FORWARDER=${{ env.FORWARDER }}" >> /opt/quibinode_navigator/.env
echo "export ACTIVE_BRIDGE=${{ env.ACTIVE_BRIDGE }}" >> /opt/quibinode_navigator/.env
echo "export INTERFACE=${{ env.INTERFACE }}" >> /opt/quibinode_navigator/.env
source /opt/quibinode_navigator/.env && sudo -E /opt/quibinode_navigator/rhel8-linux-hypervisor.sh || exit $?
- name: Send a repository dispatch event to restart the workflow if it failed
uses: actions/github-script@v6
if: ${{ failure() }}
with:
script: |
github.actions.createRepositoryDispatchEvent(repository_dispatch_event: {type: 'restart-workflow'})