From 7aa4ea16c05ed20330080a1bc5d59ca86bcfb03e Mon Sep 17 00:00:00 2001 From: c-bordon Date: Wed, 4 Sep 2024 08:07:32 -0300 Subject: [PATCH] Updated install and remove packages task --- .../ansible_playbooks/ova_generator.yaml | 71 ++++++++++--------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ansible_playbooks/ova_generator.yaml b/.github/workflows/ansible_playbooks/ova_generator.yaml index 78ed2f7..3e6b9df 100644 --- a/.github/workflows/ansible_playbooks/ova_generator.yaml +++ b/.github/workflows/ansible_playbooks/ova_generator.yaml @@ -4,6 +4,30 @@ ova_path: '/var/provision/wazuh-virtual-machines' wia_scripts: 'wazuh-installation-assistant' wia_repository: 'https://github.com/wazuh/wazuh-installation-assistant/' + packages_to_uninstall: + - ec2-instance-connect + - amazon-ssm-agent + - ec2-hibinit-agent + - ec2-net-utils + - ec2-utils + - ec2-instance-connect + - aws-cfn-bootstrap + - ucpid + - amazon-linux-extras-yum-plugin + - dracut-config-ec2 + - dracut-fips + - ec2-instance-connect-selinux + - grub2-efi-x64-ec2 + - grub2-tools-efi + - grub2-tools-extra + - hibagent + - hmaccalc + packages_to_install: + - amazon-linux-onprem + - apr + - apr-util + - cpp + - gcc tasks: - name: Install git @@ -48,6 +72,18 @@ async: 3600 poll: 10 + - name: Install additional packages + yum: + name: "{{ item }}" + state: present + with_items: "{{ packages_to_install }}" + + - name: Remove unneeded packages + yum: + name: "{{ item }}" + state: absent + with_items: "{{ packages_to_uninstall }}" + - name: Clean provision files file: path: /var/provision/ @@ -96,41 +132,6 @@ name: ec2-user state: absent - - name: Remove ec2-instance-connect - yum: - name: ec2-instance-connect - state: absent - - - name: Remove amazon-ssm-agent - yum: - name: amazon-ssm-agent - state: absent - - - name: Remove ec2-hibinit-agent - yum: - name: ec2-hibinit-agent - state: absent - - - name: Remove ec2-net-utils - yum: - name: ec2-net-utils - state: absent - - - name: Remove ec2-utils - yum: - name: ec2-utils - state: absent - - - name: Remove ec2-instance-connect - yum: - name: ec2-instance-connect - state: absent - - - name: Remove aws-cfn-bootstrap - yum: - name: aws-cfn-bootstrap - state: absent - - name: Change ssh port to 22 replace: path: /etc/ssh/sshd_config