46 lines
998 B
YAML
46 lines
998 B
YAML
---
|
|
- name: Update Packages
|
|
ansible.builtin.dnf:
|
|
update_cache: yes
|
|
|
|
- name: Apply security updates
|
|
ansible.builtin.dnf:
|
|
name: "*"
|
|
state: latest
|
|
security: yes
|
|
update_cache: yes
|
|
|
|
- name: Install Packages
|
|
ansible.builtin.dnf:
|
|
name:
|
|
- vim
|
|
- podman
|
|
- fail2ban
|
|
- python3-libdnf5
|
|
state: present
|
|
|
|
- name: Copy Wazuh agent RPM to host
|
|
ansible.builtin.copy:
|
|
src: "{{ playbook_dir }}/{{ wazuh_agent_rpm }}"
|
|
dest: "/tmp/{{ wazuh_agent_rpm }}"
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
|
|
- name: Install Wazuh agent RPM
|
|
ansible.builtin.dnf:
|
|
name: "/tmp/{{ wazuh_agent_rpm }}"
|
|
state: present
|
|
|
|
- name: Point Wazuh agent at Wazuh manager
|
|
ansible.builtin.replace:
|
|
path: /var/ossec/etc/ossec.conf
|
|
regexp: '<address>MANAGER_IP</address>'
|
|
replace: '<address>{{ wazuh_server_address }}</address>'
|
|
|
|
- name: Enable and start Wazuh agent
|
|
ansible.builtin.systemd:
|
|
name: wazuh-agent
|
|
enabled: true
|
|
state: started
|