diff --git a/.github/workflows/packages_builder_ami.yaml b/.github/workflows/packages_builder_ami.yaml index 23cf6fb..028bc72 100644 --- a/.github/workflows/packages_builder_ami.yaml +++ b/.github/workflows/packages_builder_ami.yaml @@ -79,8 +79,16 @@ jobs: WAZUH_VERSION=$(cat VERSION) echo WAZUH_VERSION=$WAZUH_VERSION >> $GITHUB_ENV + - name: Install Python and create virtual environment + run: | + sudo apt-get update + sudo apt install -y python3 && sudo apt-get install python3-venv + python3 -m venv ami_env + - name: Install Ansible - run: sudo apt-get update && sudo apt install -y python3 && python3 -m pip install --user ansible-core==2.16 --break-system-packages + run: | + source ami_env/bin/activate + python3 -m pip install --user ansible-core==2.16 - name: Ansible version run: ansible --version @@ -95,11 +103,13 @@ jobs: - name: Install and set allocator requirements run: | - pip3 install -r wazuh-automation/deployability/deps/requirements.txt --break-system-packages + source ami_env/bin/activate + python3 -m pip install -r wazuh-automation/deployability/deps/requirements.txt - name: Execute allocator module that will create the base instance id: alloc_vm_ami run: | + source ami_env/bin/activate python3 wazuh-automation/deployability/modules/allocation/main.py --action create --provider aws --size large --composite-name ${{ env.COMPOSITE_NAME }} --working-dir ${{ env.ALLOCATOR_PATH }} \ --track-output ${{ env.ALLOCATOR_PATH }}/track.yml --inventory-output ${{ env.ALLOCATOR_PATH }}/inventory.yml --instance-name gha_${{ github.run_id }}_ami_build \ --label-team devops --label-termination-date 1d