Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 4.10.2 into master #115

Merged
merged 157 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
c817edd
Changed automation reference input parameter
davidcr01 Aug 27, 2024
aadf487
Fixed runs-on parameter
davidcr01 Aug 27, 2024
058150a
Added view parameters step
davidcr01 Aug 27, 2024
b719d82
Added composite name variable set
davidcr01 Aug 27, 2024
1d84840
Added Ansible installation step
davidcr01 Aug 27, 2024
f2f10bd
Added AWS credentials setup and automation checkout steps
davidcr01 Aug 27, 2024
7321b14
Added allocator instance provision
davidcr01 Aug 27, 2024
81033b9
Added allocator instance deletion
davidcr01 Aug 27, 2024
549f9b3
Added provision playbook execution
davidcr01 Aug 28, 2024
509a003
Changed boolean variables in provision playbook
davidcr01 Aug 28, 2024
d8e5c9b
Removed ansible_pkg_mgr variable in provision playbook
davidcr01 Aug 28, 2024
249f9a3
Removed DNF block
davidcr01 Aug 28, 2024
622e328
Changed apt/yum for package
davidcr01 Aug 28, 2024
cc55350
Adding modules directly
davidcr01 Aug 28, 2024
a338d17
Adding ansible dependencies
davidcr01 Aug 28, 2024
2be9970
Debugging ansible version
davidcr01 Aug 28, 2024
1e37109
Changing YUM to DNF
davidcr01 Aug 28, 2024
d4c26b0
Using package module
davidcr01 Aug 28, 2024
08b193e
Installing Ansible with pip
davidcr01 Aug 28, 2024
eae9a6c
Adding Python install in CentOS 8
davidcr01 Aug 29, 2024
529489b
Moved variables to env variables
davidcr01 Aug 29, 2024
b701e90
Moved variables to env variables
davidcr01 Aug 29, 2024
5ac37db
Added AIO installation playbook
davidcr01 Aug 30, 2024
e3126bb
Added assistant pytest playbook
davidcr01 Aug 30, 2024
38ac911
Replaced debug input by verbosity input
davidcr01 Aug 30, 2024
9455831
Allocator VM is deleted conditionally
davidcr01 Sep 2, 2024
128845d
Deleted conditionals in Debian pip3 installation
davidcr01 Sep 2, 2024
4bbb703
Added async and poll parameters to AIO task
davidcr01 Sep 2, 2024
43fb084
Added allocator instance directory upload
davidcr01 Sep 2, 2024
dcc5de6
Deleted debug tasks and improved task names
davidcr01 Sep 2, 2024
898f53d
Python 3.9 is only installed in Ubuntu 22
davidcr01 Sep 3, 2024
3484f59
Installed Python3.6 in Ubuntu Xenial at early stage
davidcr01 Sep 3, 2024
17b124f
Fixed pip installation in Ubuntu Xenial
davidcr01 Sep 3, 2024
9c8b5ca
Added python3-apt installation in Ubuntu Xenial
davidcr01 Sep 3, 2024
60d2c28
Fixed Python install in Xenial
davidcr01 Sep 3, 2024
00cf2ca
Revert testing changes
davidcr01 Sep 3, 2024
7f37280
Added matrix strategy to implement tier
davidcr01 Sep 4, 2024
6188513
Added assistant reference to form
davidcr01 Sep 5, 2024
40e80c3
Added runID to the display name
davidcr01 Sep 5, 2024
f51e9db
Artifacts have unique name
davidcr01 Sep 5, 2024
d4afdaf
Deleted tier workflow
davidcr01 Sep 5, 2024
bddc228
Added provision and deletion of instances
davidcr01 Sep 9, 2024
758dda9
Added private IP capture
davidcr01 Sep 9, 2024
e6fe051
Added certificates generation logic
davidcr01 Sep 10, 2024
5fbb84f
Added certificates generation logic
davidcr01 Sep 10, 2024
ca9051f
Added certificates copy playbook execution
davidcr01 Sep 10, 2024
48bb2b8
Added indexer install playbook execution
davidcr01 Sep 10, 2024
ddbadbc
Added server playbook and task in distributed workflow
davidcr01 Sep 10, 2024
d70f826
Added dashboard install playbook execution
davidcr01 Sep 10, 2024
cc14906
Added indexer cluster start playbook execution
davidcr01 Sep 10, 2024
b0ff7f4
Changed indexer cluster playbook execution order
davidcr01 Sep 10, 2024
d89b91c
Fixed manager check in distributed deployment
davidcr01 Sep 11, 2024
e41f764
Updated CHANGELOG for #52
davidcr01 Sep 11, 2024
49e096d
Fix bug when changing the Filebeat URL
Enaraque Sep 11, 2024
4f42cc1
Fixed typo in CHANGELOG
davidcr01 Sep 12, 2024
0f7bb3a
Add builder condition to use tag when testing a pre-release
Enaraque Sep 12, 2024
485e361
Merge pull request #52 from wazuh/bug/51-manager-check-fails-distributed
c-bordon Sep 12, 2024
3055495
Merge pull request #53 from wazuh/bug/wp-3099-checkfilebeaturl-does-n…
c-bordon Sep 12, 2024
db5e1ca
Merge pull request #54 from wazuh/bug/wp-3092-wazuh-installation-assi…
c-bordon Sep 12, 2024
91e970f
Changed TOKEN obtaining order
davidcr01 Sep 13, 2024
12d7a37
Updated CHANGELOG for #57
davidcr01 Sep 13, 2024
b29e4e5
Workers wait master node to be installed
davidcr01 Sep 13, 2024
7244372
Added distributed test playbook execution
davidcr01 Sep 13, 2024
008e2c7
Improving the playbooks output
davidcr01 Sep 13, 2024
c2d44bb
Added allocator info upload as artifact
davidcr01 Sep 16, 2024
1d46ba6
Removed logs save logic
davidcr01 Sep 16, 2024
841f568
Removed logs save logic
davidcr01 Sep 16, 2024
4864a73
Changed repository reference to the workflow branch
davidcr01 Sep 16, 2024
f21e89a
Added README for workflows
davidcr01 Sep 16, 2024
8c43c11
Changed repository reference to the workflow branch
davidcr01 Sep 16, 2024
e6bda9c
Changed default OSs
davidcr01 Sep 16, 2024
996e6c9
Update SECURITY.md file
Enaraque Sep 13, 2024
cccd735
Updated CHANGELOG for #60
davidcr01 Sep 17, 2024
daaf1fc
Updated CHANGELOG for #46
davidcr01 Sep 17, 2024
010fc2d
Update CHANGELOG
Enaraque Sep 17, 2024
65e4e32
Merge pull request #59 from wazuh/change/58-update-security-policy
teddytpc1 Sep 17, 2024
2b0dacd
Changing systems when PR is created
davidcr01 Sep 17, 2024
faa1d25
Changed references of unattended
davidcr01 Sep 17, 2024
959d1e5
Merge branch '4.10.0' into enhancement/20-assisntant-workflow-develop…
davidcr01 Sep 17, 2024
c5a7b50
Changed order in CHANGELOG
davidcr01 Sep 18, 2024
eebeb6c
Merge branch '4.10.0' into enhancement/20-rework-distributed-workflow…
davidcr01 Sep 18, 2024
8cd8a86
Merge pull request #46 from wazuh/enhancement/20-assisntant-workflow-…
c-bordon Sep 18, 2024
31428bd
Merge branch '4.10.0' into enhancement/20-rework-distributed-workflow…
davidcr01 Sep 18, 2024
8c4d2a9
Merge pull request #60 from wazuh/enhancement/20-rework-distributed-w…
c-bordon Sep 18, 2024
08bf5ab
Migrated repository selection to assistant script
davidcr01 Sep 19, 2024
aa24083
Improved repository selection
davidcr01 Sep 19, 2024
6b1d905
Improved repository selection
davidcr01 Sep 19, 2024
7b6808e
Merge branch '4.10.0' into change/63-migrate-repository-selection-fro…
davidcr01 Sep 19, 2024
09a5abe
Adapted GHAs with the repository selection migration
davidcr01 Sep 20, 2024
0894ddd
Modified assistant reference for testing
davidcr01 Sep 20, 2024
a27a969
Added #57 changes for testing
davidcr01 Sep 20, 2024
dc20134
added gpg key import in offline installation
CarlosALgit Sep 10, 2024
282f706
change import gpg command
CarlosALgit Sep 10, 2024
e466853
added gpg key import in offline installation
CarlosALgit Sep 10, 2024
f5434a1
change import gpg command
CarlosALgit Sep 10, 2024
521f568
change filebeat passwords only when needed
CarlosALgit Sep 11, 2024
a58d971
Merge pull request #71 from wazuh/maintenance/69-merge-#3118-wazuh-pa…
davidcr01 Sep 23, 2024
dcca470
Merge pull request #70 from wazuh/maintenance/69-merge-#3110-wazuh-pa…
davidcr01 Sep 23, 2024
dc9d9fc
Reverted changes for testing
davidcr01 Sep 24, 2024
a1b03c3
Merge pull request #57 from wazuh/bug/51-manager-check-change-order
davidcr01 Sep 24, 2024
bc03ca3
Changed source_branch for 4.10.0-alpha1
davidcr01 Sep 24, 2024
707ab06
Merge pull request #73 from wazuh/enhancement/68-change-tag
davidcr01 Sep 24, 2024
70a5f0e
Reverted source_branch for 4.10.0-alpha1
davidcr01 Sep 24, 2024
52dead2
Merge pull request #74 from wazuh/enhancement/68-revert-tag
davidcr01 Sep 24, 2024
d8742d0
Merge pull request #72 from wazuh/change/63-migrate-repository-select…
c-bordon Sep 24, 2024
5855d12
Add header and build files steps
Enaraque Sep 17, 2024
44f72dd
Add step to upload artifacts to s3
Enaraque Sep 19, 2024
dc81d33
Remove acl
Enaraque Sep 19, 2024
202c097
Add short commmit sha and fix s3 repository path
Enaraque Sep 19, 2024
9a57c77
Add s3 bucket as secret
Enaraque Sep 24, 2024
71882dd
Change version to reference in the branch
Enaraque Sep 24, 2024
a18ee42
Bump version to 4.10.1
Enaraque Sep 24, 2024
e79c307
Merge pull request #76 from wazuh/enhancement/75-bump-to-4.10.1-version
c-bordon Sep 24, 2024
814be0d
Update changelog
Enaraque Sep 24, 2024
aa18f6c
Change changelog and update artifact execution
Enaraque Sep 25, 2024
56a48d1
Remove branch reference and generate artifact step
Enaraque Sep 25, 2024
b3b1e4c
Merge pull request #77 from wazuh/enhancement/55-create-a-gha-workflo…
c-bordon Sep 26, 2024
bc6effd
Added architecture information to assistant
davidcr01 Oct 2, 2024
9c63d35
Updated CHANGELOG for #92
davidcr01 Oct 2, 2024
99f78c3
Merge pull request #92 from wazuh/enhancement/83-add-arch-info-assistant
c-bordon Oct 2, 2024
de28758
Bumped branch 4.10.2 to 4.10.2 version
c-bordon Oct 3, 2024
4544fc2
Merge pull request #94 from wazuh/Bump-4.10.2-branch
c-bordon Oct 3, 2024
4c99a43
added wazuh-installation-assistant reference input
CarlosALgit Oct 8, 2024
4df3157
changed actions/checkout to v4
CarlosALgit Oct 8, 2024
42738d8
Testing function check prerequisites
c-bordon Oct 8, 2024
3792933
changelog updated
CarlosALgit Oct 8, 2024
af78494
Merge pull request #98 from wazuh/change/97-new-input-for-wazuh-autom…
c-bordon Oct 8, 2024
7b9b80d
Fix dependences variables values in offline install
Enaraque Oct 8, 2024
65c9685
unified ifs
CarlosALgit Oct 9, 2024
ef980f5
updated the changelog
CarlosALgit Oct 9, 2024
e2f3938
Resolve changelog conflicts
Enaraque Oct 9, 2024
52f7704
Merge pull request #99 from wazuh/bug/96-the-offline_checkprerequisit…
c-bordon Oct 9, 2024
d53eb30
Change source branch
teddytpc1 Oct 10, 2024
b37eee4
Merge pull request #103 from wazuh/change/102-source-branch
c-bordon Oct 10, 2024
69daafd
Revert source branch
c-bordon Oct 10, 2024
1680666
Merge pull request #104 from wazuh/revert/102-source-branch
c-bordon Oct 10, 2024
1c4433a
Add checksum step with artifact to test it
Enaraque Oct 11, 2024
6b9698f
Fix file basename
Enaraque Oct 11, 2024
31f0d42
Add upload to s3 steps
Enaraque Oct 11, 2024
2480879
Add bucket as string
Enaraque Oct 11, 2024
2867c50
Fix s3 path
Enaraque Oct 11, 2024
fc19b19
Change URI echo ti maintain consistency
Enaraque Oct 11, 2024
231805a
Changed GitHub Runner version to fix Python error
c-bordon Oct 15, 2024
4240e02
Updated changelog
c-bordon Oct 15, 2024
28c6c2f
Merge pull request #110 from wazuh/bug/wa-1891-Update-GitHub-Runner-V…
c-bordon Oct 16, 2024
b0b7347
Change variables name
Enaraque Oct 16, 2024
3a194d8
Merge branch '4.10.0' into bug/105-wazuh-installation-assistant-workf…
Enaraque Oct 16, 2024
5b13891
Update changelog
Enaraque Oct 16, 2024
d24d2a5
Fix s3 bucket env variable
Enaraque Oct 16, 2024
632a162
Remove -tool from echo in upload files to S3 step
Enaraque Oct 16, 2024
f4e98fe
Merge pull request #106 from wazuh/bug/105-wazuh-installation-assista…
c-bordon Oct 16, 2024
7aa178b
Merge 4.10.0 into 4.10.1
c-bordon Oct 17, 2024
8bf006e
Merge pull request #113 from wazuh/merge-4.10.0-into-4.10.1
teddytpc1 Oct 17, 2024
13b9b64
Merge 4.10.1 into 4.10.2
c-bordon Oct 17, 2024
a32371b
Merge pull request #114 from wazuh/merge-4.10.1-into-4.10.2
teddytpc1 Oct 17, 2024
33f313b
Merge 4.10.2 into main
c-bordon Oct 17, 2024
98a30c5
Conflicts resolved to merge 4.10.2 into main
c-bordon Oct 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Installation assistant workflows

This repository includes several GitHub Actions workflows. These workflows are designed to automate the testing process for the installation of the Wazuh Installation Assistant in various environments and to build the different tools and scripts.

## Workflows Overview

1. `Test_installation_assistant`.
This workflow tests the installation of the Wazuh Installation Assistant in a single-node setup. It triggers on pull requests that modify specific directories or files, and can also be manually dispatched.

2. `Test_installation_assistant_distributed`.
This workflow is an extension of the Test_installation_assistant workflow, intended for distributed environments. It provisions three instances and simulates a distributed Wazuh deployment across multiple nodes (indexers, managers, and dashboards).

## Triggering the Workflows
### Automatic Trigger
The workflows tests are triggered automatically when a pull request (PR) is created or updated, affecting the following paths:

- `cert_tool/`
- `common_functions/`
- `config/`
- `install_functions/`
- `passwords_tool/`
- `tests/`

### Manual Trigger
The test workflows can be triggered manually via the GitHub interface under the "Actions" tab, using the workflow_dispatch event. When triggered manually, several input parameters are required:

- **REPOSITORY**: Defines the repository environment (e.g., staging, pre-release).
- **AUTOMATION_REFERENCE**: The branch or tag of the `wazuh-automation` repository, used to clone the Allocation module.
- **SYSTEMS**: A comma-separated list of operating systems to be tested, enclosed in square brackets (e.g., `["CentOS_8", "AmazonLinux_2", "Ubuntu_22", "RHEL8"]`). The available options are: `CentOS_7`, `CentOS_8`, `AmazonLinux_2`, `Ubuntu_16`, `Ubuntu_18`, `Ubuntu_20`, `Ubuntu_22`, `RHEL7`, `RHEL8`.
- **VERBOSITY**: The verbosity level for Ansible playbook execution, with options `-v`, `-vv`, `-vvv`, and `-vvvv`.
- **DESTROY**: Boolean value (true or false) indicating whether to destroy the instances after testing.

## Workflow Structure
### Jobs

The tests workflows follow a similar structure with the following key jobs:

1. **Checkout Code**: The workflow fetches the latest code from the wazuh-automation and wazuh-installation-assistant repositories.

2. **Set Up Environment**: The operating system is configured based on the selected OS in the SYSTEMS input. The corresponding OS name is stored in the environment variable COMPOSITE_NAME.

3. **Install Ansible**: Ansible is installed for managing the provisioning of instances and running the necessary playbooks.

4. **Provisioning Instances**: The distributed workflow allocates AWS instances using the wazuh-automation repository’s allocation module. It provisions indexers, managers, and dashboards across the instances. The instance inventory is dynamically created and used for later playbook executions.

5. **Ansible Playbooks Execution**: Provision playbooks are executed to prepare the environments for Wazuh components.

6. **Test Execution**: A Python-based testing framework is executed to verify the successful installation and functionality of the Wazuh components on the allocated instances.

7. **Destroy Instances (Optional)**: If the `DESTROY` parameter is set to true, the allocated AWS instances are terminated after the tests. If set to false, the instances and their details are saved as artifacts for later analysis.

### Artifacts
If instances are not destroyed, the workflow compresses the allocated instances' directory and uploads it as an artifact. Also, the artifacts are compressed with a password. Ask @devel-devops teams for this password. An artifact is uploaded per OS selected.
## Notes
- Instance allocation: The `Test_installation_assistant_distributed` workflow provisions three instances by default. The roles are distributed as follows:
- `indexer1`, `indexer2`, `indexer3`: Indexers in the Wazuh cluster.
- `master`, `worker1`, `worker2`: Wazuh managers, where `master` is the main manager, and `worker1` and `worker2` are worker nodes.
- `dashboard`: Wazuh dashboard.

- Customization: These workflows allow for customization through the various input parameters, making it easy to test different operating systems, verbosity levels, or different versions of the repositories.
200 changes: 175 additions & 25 deletions .github/workflows/Test_installation_assistant.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
run-name: Test installation assistant - System ${{ inputs.SYSTEM }} - Launched by @${{ github.actor }}
run-name: Test installation assistant - ${{ github.run_id }} - ${{ inputs.SYSTEMS }} - Launched by @${{ github.actor }}
name: Test installation assistant

on:
Expand All @@ -20,43 +20,193 @@ on:
options:
- staging
- pre-release
WAZUH_INSTALLATION_ASSISTANT_REFERENCE:
description: 'Branch or tag of the wazuh-installation-assistant repository'
required: true
default: 'main'
AUTOMATION_REFERENCE:
description: 'wazuh-automation reference'
description: 'Branch or tag of the wazuh-automation repository'
required: true
default: 'master'
SYSTEMS:
description: 'Operating Systems (list of comma-separated quoted strings enclosed in square brackets)'
required: true
default: 'v5.0.0'
SYSTEM:
description: 'Operating System'
default: '["CentOS_8", "AmazonLinux_2", "Ubuntu_22", "RHEL8"]'
type: string
VERBOSITY:
description: 'Verbosity level on playbooks execution'
required: true
default: 'CentOS 8'
default: '-v'
type: choice
options:
- CentOS 7
- CentOS 8
- Amazon Linux 2
- Ubuntu 16
- Ubuntu 18
- Ubuntu 20
- Ubuntu 22
- RHEL7
- RHEL8
DEBUG:
description: 'Debug mode'
required: true
default: false
type: boolean
- -v
- -vv
- -vvv
- -vvvv
DESTROY:
description: 'Destroy instances after run'
required: true
default: true
type: boolean

env:
LABEL: ubuntu-latest
COMPOSITE_NAME: "linux-SUBNAME-amd64"
SESSION_NAME: "Installation-Assistant-Test"
REGION: "us-east-1"
TMP_PATH: "/tmp/test"
LOGS_PATH: "${{ github.workspace }}/assistant_logs"
PKG_REPOSITORY: "${{ inputs.REPOSITORY }}"
TEST_NAME: "test_assistant"
REPOSITORY_URL: "${{ github.server_url }}/${{ github.repository }}.git"
ALLOCATOR_PATH: "/tmp/allocator_instance"

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

jobs:
initialize-environment:
runs-on: $LABEL
run-test:
runs-on: ubuntu-22.04
strategy:
fail-fast: false # If a job fails, the rest of jobs will not be canceled
matrix:
system: ${{ fromJson(inputs.SYSTEMS) }}

steps:
- name: Set up Git
uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.WAZUH_INSTALLATION_ASSISTANT_REFERENCE }}

- name: View parameters
run: echo "${{ toJson(inputs) }}"

- name: Set COMPOSITE_NAME variable
run: |
case "${{ matrix.system }}" in
"CentOS_7")
SUBNAME="centos-7"
;;
"CentOS_8")
SUBNAME="centos-8"
;;
"AmazonLinux_2")
SUBNAME="amazon-2"
;;
"Ubuntu_16")
SUBNAME="ubuntu-16.04"
;;
"Ubuntu_18")
SUBNAME="ubuntu-18.04"
;;
"Ubuntu_20")
SUBNAME="ubuntu-20.04"
;;
"Ubuntu_22")
SUBNAME="ubuntu-22.04"
;;
"RHEL7")
SUBNAME="redhat-7"
;;
"RHEL8")
SUBNAME="redhat-8"
;;
*)
echo "Invalid SYSTEM selection" >&2
exit 1
;;
esac
COMPOSITE_NAME="${COMPOSITE_NAME/SUBNAME/$SUBNAME}"
echo "COMPOSITE_NAME=$COMPOSITE_NAME" >> $GITHUB_ENV

- name: Install Ansible
run: sudo apt-get update && sudo apt install -y python3 && python3 -m pip install --user ansible-core==2.16

- name: Set up AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
role-session-name: ${{ env.SESSION_NAME }}
aws-region: ${{ env.REGION }}

- name: Checkout wazuh/wazuh-automation repository
uses: actions/checkout@v4
with:
repository: wazuh/wazuh-automation
ref: ${{ inputs.AUTOMATION_REFERENCE }}
token: ${{ secrets.GH_CLONE_TOKEN }}
path: wazuh-automation

- name: Install and set allocator requirements
run: pip3 install -r wazuh-automation/deployability/deps/requirements.txt

- name: Allocate instance test and set SSH variables
id: allocator_instance
run: |
python3 wazuh-automation/deployability/modules/allocation/main.py --action create --provider aws --size large --composite-name ${{ env.COMPOSITE_NAME }} --working-dir $ALLOCATOR_PATH \
--track-output $ALLOCATOR_PATH/track.yml --inventory-output $ALLOCATOR_PATH/inventory.yml --instance-name gha_${{ github.run_id }}_assistant_test \
--label-team devops --label-termination-date 1d

sed 's/: */=/g' $ALLOCATOR_PATH/inventory.yml > $ALLOCATOR_PATH/inventory_mod.yml
sed -i 's/-o StrictHostKeyChecking=no/\"-o StrictHostKeyChecking=no\"/g' $ALLOCATOR_PATH/inventory_mod.yml
source $ALLOCATOR_PATH/inventory_mod.yml

echo "[gha_instance]" > $ALLOCATOR_PATH/inventory
echo "$ansible_host ansible_port=$ansible_port ansible_user=$ansible_user ansible_ssh_private_key_file=$ansible_ssh_private_key_file ansible_ssh_common_args='$ansible_ssh_common_args'" >> $ALLOCATOR_PATH/inventory

- name: Execute provision playbook
run: |
INSTALL_DEPS=true
INSTALL_PYTHON=true
INSTALL_PIP_DEPS=true

ansible-playbook .github/workflows/ansible-playbooks/provision.yml \
-i $ALLOCATOR_PATH/inventory \
-l all \
-e "repository=$REPOSITORY_URL" \
-e "reference=${{ github.ref_name }}" \
-e "tmp_path=$TMP_PATH" \
-e "install_deps=$INSTALL_DEPS" \
-e "install_python=$INSTALL_PYTHON" \
-e "install_pip_deps=$INSTALL_PIP_DEPS" \
"${{ inputs.VERBOSITY }}"

- name: Execute AIO installation playbook
run: |
ansible-playbook .github/workflows/ansible-playbooks/aio.yml \
-i $ALLOCATOR_PATH/inventory \
-l all \
-e "tmp_path=$TMP_PATH" \
-e "logs_path=$LOGS_PATH" \
-e "test_name=$TEST_NAME" \
-e "pkg_repository=$PKG_REPOSITORY" \
"${{ inputs.VERBOSITY }}"

- name: Execute Python test playbook
run: |
TEST_NAME="test_installation_assistant"
ansible-playbook .github/workflows/ansible-playbooks/aio_tests.yml \
-i $ALLOCATOR_PATH/inventory \
-l all \
-e "tmp_path=$TMP_PATH" \
-e "logs_path=$LOGS_PATH" \
-e "test_name=$TEST_NAME" \
"${{ inputs.VERBOSITY }}"

- name: Compress Allocator VM directory
id: compress_allocator_files
if: always() && steps.allocator_instance.outcome == 'success' && inputs.DESTROY == false
run: |
zip -P "${{ secrets.ZIP_ARTIFACTS_PASSWORD }}" -r $ALLOCATOR_PATH.zip $ALLOCATOR_PATH

- name: Upload Allocator VM directory as artifact
if: always() && steps.compress_allocator_files.outcome == 'success' && inputs.DESTROY == false
uses: actions/upload-artifact@v4
with:
name: allocator-instance-${{ matrix.system }}
path: ${{ env.ALLOCATOR_PATH }}.zip

- name: Delete allocated VM
if: always() && steps.allocator_instance.outcome == 'success' && inputs.DESTROY == true
run: python3 wazuh-automation/deployability/modules/allocation/main.py --action delete --track-output $ALLOCATOR_PATH/track.yml

Loading
Loading