Skip to content

Commit

Permalink
Added allocator instance provision
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcr01 committed Aug 27, 2024
1 parent 40318eb commit 73920ab
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/Test_installation_assistant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,27 @@ jobs:
repository: wazuh/wazuh-automation
ref: ${{ inputs.AUTOMATION_REFERENCE }}
token: ${{ secrets.GH_CLONE_TOKEN }}

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

- name: Execute allocator module and set ssh variables to create OVA VM
id: allocator_instance
run: |
python3 deployability/modules/allocation/main.py --action create --provider aws --size large --composite-name ${{ env.COMPOSITE_NAME }} --working-dir /tmp/allocator_instance \
--track-output /tmp/allocator_instance/track.yml --inventory-output /tmp/allocator_instance/inventory.yml --instance-name gha_${{ github.run_id }}_assistant_test \
--label-team devops --label-termination-date 1d
sed 's/: */=/g' /tmp/allocator_instance/inventory.yml > /tmp/allocator_instance/inventory_mod.yml
source /tmp/allocator_instance/inventory_mod.yml
echo "[gha_instance]" > /tmp/allocator_instance/inventory_ansible.ini
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'" >> /tmp/allocator_instance/inventory_ansible.ini
echo "::add-mask::$ansible_host"
echo "::add-mask::$ansible_port"
echo "::add-mask::$ansible_user"
echo "::add-mask::$ansible_ssh_private_key_file"
echo "::add-mask::$ansible_ssh_common_args"
cat "/tmp/allocator_instance/inventory_mod.yml" >> $GITHUB_ENV;
cat /tmp/allocator_instance/inventory_ansible.ini

0 comments on commit 73920ab

Please sign in to comment.