Install wazuh agent deb file for linux target hosts

30 views
Skip to first unread message

malek sakir

unread,
Jun 14, 2023, 6:35:43 AM6/14/23
to Ansible Project
any one help me to write playbook for wazuh agent(.deb file)  installation in linux target hosts.

Dick Visser

unread,
Jun 14, 2023, 8:00:24 AM6/14/23
to ansible...@googlegroups.com
On Wed, 14 Jun 2023 at 12:35, malek sakir <2141.ma...@gmail.com> wrote:
any one help me to write playbook for wazuh agent(.deb file)  installation in linux target hosts.


khawaja Ali

unread,
Jun 14, 2023, 9:19:17 AM6/14/23
to ansible...@googlegroups.com
I have not tested it, check it yourself. Ali
---
- name: Install Wazuh agent
  hosts: <remote servers>
  become: yes
 
  tasks:
    - name: Add Wazuh repository key
      apt_key:
        url: https://packages.wazuh.com/key/GPG-KEY-WAZUH
        state: present
     
    - name: Add Wazuh repository
      apt_repository:
        repo: "deb https://packages.wazuh.com/4.x/apt/ stable main"
        state: present
     
    - name: Update apt cache
      apt:
        update_cache: yes
     
    - name: Install Wazuh agent
      apt:
        name: wazuh-agent
        state: present
     
    - name: Configure Wazuh agent
      copy:
        src: /path/to/wazuh-agent.conf
        dest: /var/ossec/etc/shared/wazuh-agent.conf
        owner: root
        group: ossec
        mode: '0640'
      notify:
        - restart wazuh-agent
     
  handlers:
    - name: restart wazuh-agent
      service:
        name: wazuh-agent


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAF8BbLZviBUWnXVETjAtQJGUWOHP9%3Dbq-g2qF5dQU%2BrfbFOKeA%40mail.gmail.com.

khawaja Ali

unread,
Jun 14, 2023, 9:21:31 AM6/14/23
to ansible...@googlegroups.com
correction
---
        state: restarted
Reply all
Reply to author
Forward
0 new messages