Move the 'become' for privilege escalation to appropiate hosts only
This commit is contained in:
parent
9704b6e790
commit
45d7a2357d
@ -1,7 +1,5 @@
|
|||||||
---
|
---
|
||||||
- hosts: <your wazuh agents hosts>
|
- hosts: <your wazuh agents hosts>
|
||||||
become: yes
|
|
||||||
become_user: root
|
|
||||||
roles:
|
roles:
|
||||||
- ../roles/wazuh/ansible-wazuh-agent
|
- ../roles/wazuh/ansible-wazuh-agent
|
||||||
vars:
|
vars:
|
||||||
@ -13,4 +11,4 @@
|
|||||||
api_proto: 'https'
|
api_proto: 'https'
|
||||||
api_user: wazuh
|
api_user: wazuh
|
||||||
max_retries: 5
|
max_retries: 5
|
||||||
retry_interval: 5
|
retry_interval: 5
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
---
|
---
|
||||||
- name: restart wazuh-agent
|
- name: restart wazuh-agent
|
||||||
service: name=wazuh-agent state=restarted enabled=yes
|
service: name=wazuh-agent state=restarted enabled=yes
|
||||||
|
become: yes
|
||||||
|
|
||||||
- name: Windows | Restart Wazuh Agent
|
- name: Windows | Restart Wazuh Agent
|
||||||
win_service: name=WazuhSvc start_mode=auto state=restarted
|
win_service: name=WazuhSvc start_mode=auto state=restarted
|
||||||
|
|
||||||
- name: macOS | Restart Wazuh Agent
|
- name: macOS | Restart Wazuh Agent
|
||||||
command: /Library/Ossec/bin/wazuh-control restart
|
command: /Library/Ossec/bin/wazuh-control restart
|
||||||
|
become: yes
|
||||||
@ -1,11 +1,20 @@
|
|||||||
---
|
---
|
||||||
- include_tasks: "RedHat.yml"
|
- include_tasks:
|
||||||
|
file: "RedHat.yml"
|
||||||
|
apply:
|
||||||
|
become: yes
|
||||||
when: ansible_facts.os_family == "RedHat"
|
when: ansible_facts.os_family == "RedHat"
|
||||||
|
|
||||||
- include_tasks: "Debian.yml"
|
- include_tasks:
|
||||||
|
file: "Debian.yml"
|
||||||
|
apply:
|
||||||
|
become: yes
|
||||||
when: ansible_facts.os_family == "Debian"
|
when: ansible_facts.os_family == "Debian"
|
||||||
|
|
||||||
- include_tasks: "installation_from_custom_packages.yml"
|
- include_tasks:
|
||||||
|
file: "installation_from_custom_packages.yml"
|
||||||
|
apply:
|
||||||
|
become: yes
|
||||||
when:
|
when:
|
||||||
- wazuh_custom_packages_installation_agent_enabled
|
- wazuh_custom_packages_installation_agent_enabled
|
||||||
|
|
||||||
@ -262,10 +271,16 @@
|
|||||||
state: started
|
state: started
|
||||||
tags: config
|
tags: config
|
||||||
|
|
||||||
- include_tasks: "RMRedHat.yml"
|
- include_tasks:
|
||||||
|
file: "RMRedHat.yml"
|
||||||
|
apply:
|
||||||
|
become: yes
|
||||||
when:
|
when:
|
||||||
- ansible_facts.os_family == "RedHat"
|
- ansible_facts.os_family == "RedHat"
|
||||||
|
|
||||||
- include_tasks: "RMDebian.yml"
|
- include_tasks:
|
||||||
|
file: "RMDebian.yml"
|
||||||
|
apply:
|
||||||
|
become: yes
|
||||||
when:
|
when:
|
||||||
- ansible_facts.os_family == "Debian"
|
- ansible_facts.os_family == "Debian"
|
||||||
|
|||||||
@ -21,8 +21,14 @@
|
|||||||
- include_tasks: "Windows.yml"
|
- include_tasks: "Windows.yml"
|
||||||
when: ansible_facts.os_family == "Windows"
|
when: ansible_facts.os_family == "Windows"
|
||||||
|
|
||||||
- include_tasks: "Linux.yml"
|
- include_tasks:
|
||||||
|
file: "Linux.yml"
|
||||||
|
apply:
|
||||||
|
become: yes
|
||||||
when: ansible_facts.system == "Linux"
|
when: ansible_facts.system == "Linux"
|
||||||
|
|
||||||
- include_tasks: "macOS.yml"
|
- include_tasks:
|
||||||
when: ansible_facts.system == "Darwin"
|
file: "macOS.yml"
|
||||||
|
apply:
|
||||||
|
become: yes
|
||||||
|
when: ansible_facts.system == "Darwin"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user