From b5dd470c2c2caeff2e794d37bc6af57906761488 Mon Sep 17 00:00:00 2001 From: cadoming Date: Thu, 27 Dec 2018 10:49:34 +0000 Subject: [PATCH 1/4] custom name for single agent registration --- roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml b/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml index 2d17fb16..8cd5eaea 100644 --- a/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml +++ b/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml @@ -45,6 +45,7 @@ - name: Linux | Register agent (via authd) shell: > /var/ossec/bin/agent-auth + -A {{ agent_name }} -m {{ wazuh_managers.0.address }} -p {{ wazuh_agent_authd.port }} {% if authd_pass is defined %}-P {{ authd_pass }}{% endif %} @@ -55,6 +56,8 @@ {% endif %} {% if wazuh_agent_authd.ssl_auto_negotiate == 'yes' %}-a{% endif %} register: agent_auth_output + vars: + agent_name: "{% if single_agent_name is defined %}{{ single_agent_name }}{% else %}{{ ansible_hostname }}{% endif %}" when: - check_keys.stat.exists == false or check_keys.stat.size == 0 - wazuh_managers.0.address is not none @@ -87,7 +90,7 @@ url: "{{ wazuh_managers.0.api_proto }}://{{ wazuh_managers.0.address }}:{{ wazuh_managers.0.api_port }}/agents/" validate_certs: no method: POST - body: {"name":"{{ inventory_hostname }}"} + body: {"name":"{{ agent_name }}"} body_format: json status_code: 200 headers: @@ -96,6 +99,8 @@ password: "{{ api_pass }}" register: newagent_api changed_when: newagent_api.json.error == 0 + vars: + agent_name: "{% if single_agent_name is defined %}{{ single_agent_name }}{% else %}{{ inventory_hostname }}{% endif %}" when: - check_keys.stat.exists == false or check_keys.stat.size == 0 - wazuh_managers.0.address is not none From 1c7f60bb88e2d18eab027978936c41442e1b69a0 Mon Sep 17 00:00:00 2001 From: Carlos Dominguez <43823505+cadoming@users.noreply.github.com> Date: Wed, 9 Jan 2019 14:42:04 +0100 Subject: [PATCH 2/4] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15b0ec7c..9e9f7358 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. ## [v3.7.2] +### Added + +- Added custom name for single agent registration ([#117](https://github.com/wazuh/wazuh-ansible/pull/117)) + ### Changed - Adapt configuration to current release ([#106](https://github.com/wazuh/wazuh-ansible/pull/106)) From 37f57b2511949eb15521c72a1629c51779895e08 Mon Sep 17 00:00:00 2001 From: Carlos Dominguez <43823505+cadoming@users.noreply.github.com> Date: Thu, 10 Jan 2019 12:10:46 +0100 Subject: [PATCH 3/4] Bump version 3715 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 9cbf6d67..cdede417 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ WAZUH-ANSIBLE_VERSION="v3.7.2" -REVISION="3714" +REVISION="3715" From 25cda523724b707d956c6bda922df9c86e14569d Mon Sep 17 00:00:00 2001 From: Carlos Dominguez <43823505+cadoming@users.noreply.github.com> Date: Thu, 10 Jan 2019 13:02:34 +0100 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8dbaa6e..fd10dbeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. ## [v3.7.x] +### Added + +- Added custom name for single agent registration ([#117](https://github.com/wazuh/wazuh-ansible/pull/117)) + ### Changed - Changed Windows installation directory ([#116](https://github.com/wazuh/wazuh-ansible/pull/116)) @@ -13,10 +17,6 @@ All notable changes to this project will be documented in this file. ## [v3.7.2] -### Added - -- Added custom name for single agent registration ([#117](https://github.com/wazuh/wazuh-ansible/pull/117)) - ### Changed - Adapt configuration to current release ([#106](https://github.com/wazuh/wazuh-ansible/pull/106))