Skip to content

Commit

Permalink
changed SHH port of the AMI instance
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosALgit committed Oct 11, 2024
1 parent 111654f commit c7fcab5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/packages_builder_ami.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,17 @@ jobs:
echo "[gha_instance]" > ${{ env.ALLOCATOR_PATH }}/inventory_ansible.ini
echo "${{ env.ansible_host }} ansible_port=${{ env.ansible_port }} ansible_user=${{ env.ansible_user }} ansible_ssh_private_key_file=${{ env.ansible_ssh_private_key_file }} ansible_ssh_common_args='${{ env.ansible_ssh_common_args }}'" >> ${{ env.ALLOCATOR_PATH }}/inventory_ansible.ini
- name: Run Ansible playbook to install Wazuh components
run: |
ansible-playbook -i ${{ env.ALLOCATOR_PATH }}/inventory_ansible.ini ${{ env.PLAYBOOKS_PATH }}/build_ami_packages.yaml --extra-vars "installation_assistant_reference=${{ inputs.WAZUH_INSTALLATION_ASSISTANT_REFERENCE }}" ${{ inputs.VERBOSITY }}
- name: Change SSH port of the AMI instance
run: |
ssh -i "${{ env.ansible_ssh_private_key_file }}" -o StrictHostKeyChecking=no -p ${{ env.ansible_port }} ${{ env.ansible_user }}@${{ env.ansible_host }} << 'EOF'
sudo sed -i 's/^Port 2200/Port 22/' /etc/ssh/sshd_config
sudo systemctl restart sshd
EOF
- name: Stop instance
run: |
aws ec2 stop-instances --instance-ids ${{ env.identifier }}
Expand Down
2 changes: 1 addition & 1 deletion ami/playbooks/build_ami_packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
with_items:
- updateIndexerHeap

- name: Clone the wazuh-packages repository
- name: Clone the wazuh-installation-assistant repository
git:
repo: "https://github.com/wazuh/wazuh-installation-assistant.git"
version: "{{ installation_assistant_reference }}"
Expand Down

0 comments on commit c7fcab5

Please sign in to comment.