Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the possibility to set options in the agents internal configuration #1366

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions roles/wazuh/ansible-wazuh-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Role Variables

* `wazuh_managers`: Collection of Wazuh Managers' IP address, port, and protocol used by the agent
* `wazuh_agent_authd`: Collection with the settings to register an agent using authd.
* `wazuh_agent_local_options`: Optional dictionary of settings to be configured in the local_internal_options.conf file.

Playbook example
----------------
Expand All @@ -44,6 +45,9 @@ The following is an example of how this role can be used:
port: 1515
ssl_agent_ca: null
ssl_auto_negotiate: 'no'
wazuh_agent_local_options:
logcollector.remote_commands: '0'
wazuh_command.remote_commands: '1'


License and copyright
Expand Down
5 changes: 5 additions & 0 deletions roles/wazuh/ansible-wazuh-agent/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -374,3 +374,8 @@ wazuh_agent_config_defaults:

labels: '{{ wazuh_agent_labels }}'
enrollment: '{{ wazuh_agent_enrollment }}'

# additional configuration options for the internal_options.conf file
wazuh_agent_local_options: {}
wazuh_agent_local_options_defaults:
'logcollector.remote_commands': '1'
2 changes: 2 additions & 0 deletions roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@
owner: root
group: wazuh
mode: 0640
vars:
local_internal_options: '{{ wazuh_agent_local_options_defaults | combine(wazuh_agent_local_options) }}'
notify: restart wazuh-agent
tags:
- init
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
# In this file you could include the configuration settings for your agents

# Logcollector - If it should accept remote commands from the manager
logcollector.remote_commands=1

{% for _option in local_internal_options %}
{{ _option }}={{ local_internal_options[_option] }}
{% endfor %}