Skip to content

Commit 766ca30

Browse files
committed
Become consistent with become invocations
1 parent f49a774 commit 766ca30

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

etc/kayobe/ansible/wazuh-manager.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
- generate-certs
1010
# Single node
1111
- hosts: wazuh-manager
12-
become: yes
1312
become_user: root
1413
roles:
1514
- role: "{{ playbook_dir }}/roles/wazuh-ansible/wazuh-ansible/roles/wazuh/wazuh-indexer"
@@ -23,7 +22,6 @@
2322
path: "{{ local_custom_sca_policies_path }}"
2423
register: custom_sca_policies_folder
2524
delegate_to: localhost
26-
become: no
2725

2826
- name: Gather list of custom SCA policies
2927
find:
@@ -34,6 +32,7 @@
3432
when: custom_sca_policies_folder.stat.exists
3533

3634
- name: Copy custom SCA policy files to Wazuh manager
35+
become: yes
3736
copy:
3837
# Note the trailing slash to copy directory contents
3938
src: "{{ local_custom_sca_policies_path }}/"
@@ -43,6 +42,7 @@
4342
when: custom_sca_policies.files | length > 0
4443

4544
- name: Add custom policy definition(s) to the shared Agent config
45+
becomd: yes
4646
blockinfile:
4747
path: "/var/ossec/etc/shared/default/agent.conf"
4848
state: present
@@ -65,6 +65,7 @@
6565
- Restart wazuh
6666

6767
- name: Set http/s_proxy vars in ossec-init.conf for vulnerability detector
68+
become: yes
6869
blockinfile:
6970
path: "/var/ossec/etc/ossec.conf"
7071
state: present
@@ -83,9 +84,9 @@
8384
path: "{{ local_custom_certs_path }}"
8485
register: custom_certificates_folder
8586
delegate_to: localhost
86-
become: no
8787

8888
- name: Copy the node & admin certificates to Wazuh dashboard
89+
become: yes
8990
copy:
9091
src: "{{ local_custom_certs_path }}/{{ item }}"
9192
dest: /etc/wazuh-dashboard/certs/
@@ -100,9 +101,9 @@
100101
- Restart wazuh-dashboard
101102

102103
- name: Perform health check against filebeat
104+
become: yes
103105
command: filebeat test output
104106
changed_when: false
105-
become: true
106107
retries: 2
107108

108109
handlers:
@@ -117,15 +118,13 @@
117118
state: restarted
118119

119120
- hosts: wazuh-agent
120-
become: yes
121121
become_user: root
122122
tasks:
123123
- name: Check if custom SCA policies directory exists
124124
stat:
125125
path: "{{ local_custom_sca_policies_path }}"
126126
register: custom_sca_policies_folder
127127
delegate_to: localhost
128-
become: no
129128

130129
- name: Gather list of custom SCA policies
131130
find:
@@ -136,13 +135,13 @@
136135
when: custom_sca_policies_folder.stat.exists
137136

138137
- name: Allow Wazuh agents to execute commands in SCA policies sent from the Wazuh manager
138+
become: yes
139139
blockinfile:
140140
path: "/var/ossec/etc/local_internal_options.conf"
141141
state: present
142142
owner: wazuh
143143
group: wazuh
144-
block: |
145-
sca.remote_commands=1
144+
block: sca.remote_commands=1
146145
when: custom_sca_policies.files | length > 0
147146
notify:
148147
- Restart wazuh-agent

0 commit comments

Comments
 (0)