Workflow updates

This commit is contained in:
Gonzalo Acuña 2023-01-24 12:24:09 -03:00
parent e7f5c3175b
commit 552b63cf66
No known key found for this signature in database
GPG Key ID: 646BA79A313A2270
2 changed files with 12 additions and 14 deletions

View File

@ -1,5 +1,5 @@
--- ---
name: do-the-job name: AIO-Single-Instance
on: [push, pull_request, workflow_dispatch, release] on: [push, pull_request, workflow_dispatch, release]
jobs: jobs:
start-runner: start-runner:
@ -25,14 +25,13 @@ jobs:
ec2-instance-type: t3a.large ec2-instance-type: t3a.large
subnet-id: ${{ secrets.SUBNET_ID }} subnet-id: ${{ secrets.SUBNET_ID }}
security-group-id: ${{ secrets.SG_ID }} security-group-id: ${{ secrets.SG_ID }}
#iam-role-name: my-role-name # optional, requires additional permissions
aws-resource-tags: > # optional, requires additional permissions aws-resource-tags: > # optional, requires additional permissions
[ [
{"Key": "Name", "Value": "ec2-github-runner"}, {"Key": "Name", "Value": "wazuh-ansible-gh-runner-aio"},
{"Key": "GitHubRepository", "Value": "${{ github.repository }}"} {"Key": "GitHubRepository", "Value": "${{ github.repository }}"}
] ]
do-the-job: install-aio-single-instance:
name: Do the job on the runner name: Installs AIO single instance
needs: start-runner # required to start the main job when the runner is ready needs: start-runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner
steps: steps:
@ -47,7 +46,7 @@ jobs:
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: '3.x' python-version: '3.x'
- name: Ansible Playbook run Wazuh AIO - name: Ansible Playbook run Wazuh AIO Single instance
run: ansible-playbook ./.github/playbooks/aio-wazuh.yml run: ansible-playbook ./.github/playbooks/aio-wazuh.yml
env: env:
PY_COLORS: '1' PY_COLORS: '1'
@ -56,7 +55,7 @@ jobs:
name: Stop self-hosted EC2 runner name: Stop self-hosted EC2 runner
needs: needs:
- start-runner # required to get output from the start-runner job - start-runner # required to get output from the start-runner job
- do-the-job # required to wait when the main job is done - install-aio-single-instance # required to wait when the main job is done
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps: steps:

View File

@ -1,5 +1,5 @@
--- ---
name: do-the-job name: Wazuh-Single-Instance
on: [push, pull_request, workflow_dispatch, release] on: [push, pull_request, workflow_dispatch, release]
jobs: jobs:
start-runner: start-runner:
@ -25,14 +25,13 @@ jobs:
ec2-instance-type: t3.small ec2-instance-type: t3.small
subnet-id: ${{ secrets.SUBNET_ID }} subnet-id: ${{ secrets.SUBNET_ID }}
security-group-id: ${{ secrets.SG_ID }} security-group-id: ${{ secrets.SG_ID }}
#iam-role-name: my-role-name # optional, requires additional permissions
aws-resource-tags: > # optional, requires additional permissions aws-resource-tags: > # optional, requires additional permissions
[ [
{"Key": "Name", "Value": "ec2-github-runner"}, {"Key": "Name", "Value": "wazuh-ansible-gh-runner-wazuh"},
{"Key": "GitHubRepository", "Value": "${{ github.repository }}"} {"Key": "GitHubRepository", "Value": "${{ github.repository }}"}
] ]
do-the-job: install-wazuh-single-instance:
name: Do the job on the runner name: Installs Wazuh server single instance
needs: start-runner # required to start the main job when the runner is ready needs: start-runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner
steps: steps:
@ -47,7 +46,7 @@ jobs:
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: '3.x' python-version: '3.x'
- name: Ansible Playbook run Wazuh Single node instance - name: Ansible Playbook run Wazuh Single instance
run: ansible-playbook ./.github/playbooks/single-wazuh.yml run: ansible-playbook ./.github/playbooks/single-wazuh.yml
env: env:
PY_COLORS: '1' PY_COLORS: '1'
@ -56,7 +55,7 @@ jobs:
name: Stop self-hosted EC2 runner name: Stop self-hosted EC2 runner
needs: needs:
- start-runner # required to get output from the start-runner job - start-runner # required to get output from the start-runner job
- do-the-job # required to wait when the main job is done - install-wazuh-single-instance # required to wait when the main job is done
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps: steps: