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 3fec474
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/Test_installation_assistant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,36 @@ jobs:
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 }}"
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 }}

- 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 3fec474

Please sign in to comment.