From 8ef5e65eb7adea66160b5c61f33251cf55fda1fa Mon Sep 17 00:00:00 2001 From: cadoming Date: Wed, 14 Nov 2018 12:13:58 +0000 Subject: [PATCH 1/3] include template local_internal_options.conf --- roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml | 11 +++++++++++ .../var-ossec-etc-local-internal-options.conf.j2 | 12 ++++++++++++ roles/wazuh/ansible-wazuh-manager/tasks/main.yml | 11 +++++++++++ .../var-ossec-etc-local-internal-options.conf.j2 | 12 ++++++++++++ 4 files changed, 46 insertions(+) create mode 100644 roles/wazuh/ansible-wazuh-agent/templates/var-ossec-etc-local-internal-options.conf.j2 create mode 100644 roles/wazuh/ansible-wazuh-manager/templates/var-ossec-etc-local-internal-options.conf.j2 diff --git a/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml b/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml index fb0b8ce27..2d17fb168 100644 --- a/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml +++ b/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml @@ -167,6 +167,17 @@ - init - config +- name: Linux | Installing local_internal_options.conf + template: src=var-ossec-etc-local-internal-options.conf.j2 + dest=/var/ossec/etc/local_internal_options.conf + owner=root + group=ossec + mode=0640 + notify: restart wazuh-agent + tags: + - init + - config + - name: Linux | Ensure Wazuh Agent service is started and enabled service: name: wazuh-agent diff --git a/roles/wazuh/ansible-wazuh-agent/templates/var-ossec-etc-local-internal-options.conf.j2 b/roles/wazuh/ansible-wazuh-agent/templates/var-ossec-etc-local-internal-options.conf.j2 new file mode 100644 index 000000000..6e3c86a84 --- /dev/null +++ b/roles/wazuh/ansible-wazuh-agent/templates/var-ossec-etc-local-internal-options.conf.j2 @@ -0,0 +1,12 @@ +# local_internal_options.conf +# +# This file should be handled with care. It contains +# run time modifications that can affect the use +# of OSSEC. Only change it if you know what you +# are doing. Look first at ossec.conf +# for most of the things you want to change. +# +# This file will not be overwritten during upgrades. + +# This is the template of Ansible for the file local_internal_options.conf +# In this file you could include the configuration settings for your agents diff --git a/roles/wazuh/ansible-wazuh-manager/tasks/main.yml b/roles/wazuh/ansible-wazuh-manager/tasks/main.yml index 9e6191926..ad7f8cfaf 100644 --- a/roles/wazuh/ansible-wazuh-manager/tasks/main.yml +++ b/roles/wazuh/ansible-wazuh-manager/tasks/main.yml @@ -156,6 +156,17 @@ - init - config +- name: Installing the local_internal_options.conf + template: src=var-ossec-etc-local-internal-options.conf.j2 + dest=/var/ossec/etc/local_internal_options.conf + owner=root + group=ossec + mode=0640 + notify: restart wazuh-manager + tags: + - init + - config + - name: Retrieving Agentless Credentials include_vars: agentless_creeds.yml tags: diff --git a/roles/wazuh/ansible-wazuh-manager/templates/var-ossec-etc-local-internal-options.conf.j2 b/roles/wazuh/ansible-wazuh-manager/templates/var-ossec-etc-local-internal-options.conf.j2 new file mode 100644 index 000000000..5718f800d --- /dev/null +++ b/roles/wazuh/ansible-wazuh-manager/templates/var-ossec-etc-local-internal-options.conf.j2 @@ -0,0 +1,12 @@ +# local_internal_options.conf +# +# This file should be handled with care. It contains +# run time modifications that can affect the use +# of OSSEC. Only change it if you know what you +# are doing. Look first at ossec.conf +# for most of the things you want to change. +# +# This file will not be overwritten during upgrades. + +# This is the template of Ansible for the file local_internal_options.conf +# In this file you could include the configuration settings for your manager From c396bf0c647313e80c82cbdfab15c1ec41bcdf1a Mon Sep 17 00:00:00 2001 From: Carlos Dominguez <43823505+cadoming@users.noreply.github.com> Date: Fri, 16 Nov 2018 11:05:15 +0100 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 949b31aea..cc88ecdb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ All notable changes to this project will be documented in this file. ## v3.7.0-37xx +### Added +- include template local_internal_options.conf ([#87](https://github.com/wazuh/wazuh-ansible/pull/87)) ## v3.7.0-3701 From bdf913453e4b57680d6064c11af34cbc9367ccb1 Mon Sep 17 00:00:00 2001 From: cadoming Date: Fri, 16 Nov 2018 10:34:41 +0000 Subject: [PATCH 3/3] Added windows task --- roles/wazuh/ansible-wazuh-agent/tasks/Windows.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/wazuh/ansible-wazuh-agent/tasks/Windows.yml b/roles/wazuh/ansible-wazuh-agent/tasks/Windows.yml index 7b68f4ddd..914ef78b6 100644 --- a/roles/wazuh/ansible-wazuh-agent/tasks/Windows.yml +++ b/roles/wazuh/ansible-wazuh-agent/tasks/Windows.yml @@ -75,6 +75,14 @@ tags: - config +- name: Windows | Installing local_internal_options.conf + win_template: + src: var-ossec-etc-local-internal-options.conf.j2 + dest: "{{ wazuh_winagent_config.install_dir }}local_internal_options.conf" + notify: restart wazuh-agent windows + tags: + - config + - name: Windows | Delete downloaded Wazuh agent installer file win_file: path: C:\wazuh-agent-installer.msi