File tree Expand file tree Collapse file tree 2 files changed +32
-46
lines changed Expand file tree Collapse file tree 2 files changed +32
-46
lines changed Original file line number Diff line number Diff line change 55 tasks :
66 - import_role :
77 name : " wazuh-ansible/wazuh-ansible/roles/wazuh/ansible-wazuh-agent"
8+ post_tasks :
9+ - name : Check if custom SCA policies directory exists
10+ stat :
11+ path : " {{ local_custom_sca_policies_path }}"
12+ register : custom_sca_policies_folder
13+ delegate_to : localhost
14+
15+ - name : Gather list of custom SCA policies
16+ find :
17+ paths : " {{ local_custom_sca_policies_path }}"
18+ patterns : ' *.yml'
19+ delegate_to : localhost
20+ register : custom_sca_policies
21+ when : custom_sca_policies_folder.stat.exists
22+
23+ - name : Allow Wazuh agents to execute commands in SCA policies sent from the Wazuh manager
24+ become : yes
25+ blockinfile :
26+ path : " /var/ossec/etc/local_internal_options.conf"
27+ state : present
28+ owner : wazuh
29+ group : wazuh
30+ block : sca.remote_commands=1
31+ when : custom_sca_policies.files | length > 0
32+ notify :
33+ - Restart wazuh-agent
34+
35+ handlers :
36+ - name : Restart wazuh-agent
37+ service :
38+ name : wazuh-agent
39+ state : restarted
Original file line number Diff line number Diff line change 105105 command : filebeat test output
106106 changed_when : false
107107 retries : 2
108-
109- handlers :
110- - name : Restart wazuh
111- service :
112- name : wazuh-manager
113- state : restarted
114-
115- - name : Restart wazuh-dashboard
116- service :
117- name : wazuh-dashboard
118- state : restarted
119-
120- - hosts : wazuh-agent
121- become_user : root
122- tasks :
123- - name : Check if custom SCA policies directory exists
124- stat :
125- path : " {{ local_custom_sca_policies_path }}"
126- register : custom_sca_policies_folder
127- delegate_to : localhost
128-
129- - name : Gather list of custom SCA policies
130- find :
131- paths : " {{ local_custom_sca_policies_path }}"
132- patterns : ' *.yml'
133- delegate_to : localhost
134- register : custom_sca_policies
135- when : custom_sca_policies_folder.stat.exists
136-
137- - name : Allow Wazuh agents to execute commands in SCA policies sent from the Wazuh manager
138- become : yes
139- blockinfile :
140- path : " /var/ossec/etc/local_internal_options.conf"
141- state : present
142- owner : wazuh
143- group : wazuh
144- block : sca.remote_commands=1
145- when : custom_sca_policies.files | length > 0
146- notify :
147- - Restart wazuh-agent
148-
149- handlers :
150- - name : Restart wazuh-agent
151- service :
152- name : wazuh-agent
153- state : restarted
You can’t perform that action at this time.
0 commit comments