File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6363 owner : splunkfwd
6464 group : splunkfwd
6565 mode : ' 0755'
66- recurse : yes
6766 with_items :
6867 - /opt/splunkforwarder/etc/apps/auditd_app/local/
6968
7473 dest : /opt/splunkforwarder/etc/apps/auditd_app/local/inputs.conf
7574 owner : splunkfwd
7675 group : splunkfwd
77- mode : ' 0644'
78- force : yes
76+ mode : ' 0644'
Original file line number Diff line number Diff line change 1010 state : present
1111 update_cache : true
1212
13- - name : drop the osquery_install.sh script /tmp
14- become : true
15- copy :
16- src : osquery_install.sh
17- dest : /tmp/osquery_install.sh
18- mode : ' 0755'
19-
2013- name : check if osquery service exist
2114 stat : path=/etc/init.d/osqueryd
2215 register : service_status
3427 state : stopped
3528 when : service_status.stat.exists
3629
30+ - name : drop the osquery_install.sh script /tmp
31+ become : true
32+ copy :
33+ src : osquery_install.sh
34+ dest : /tmp/osquery_install.sh
35+ mode : ' 0755'
36+ when : not osquery_installed.stat.exists | default(false)
37+
3738- name : run osquery_install.sh
3839 become : true
3940 command : sh /tmp/osquery_install.sh
4445 file :
4546 path : /tmp/osquery_install.sh
4647 state : absent
48+ when : not osquery_installed.stat.exists | default(false)
4749
4850- name : copy template.osquery.conf
4951 become : true
9799 owner : splunkfwd
98100 group : splunkfwd
99101 mode : ' 0755'
100- recurse : yes
101102 with_items :
102103 - /opt/splunkforwarder/etc/apps/osquery_app/local/
103104
108109 dest : /opt/splunkforwarder/etc/apps/osquery_app/local/inputs.conf
109110 owner : splunkfwd
110111 group : splunkfwd
111- mode : ' 0644'
112- force : yes
112+ mode : ' 0644'
Original file line number Diff line number Diff line change 4343 stat :
4444 path : /etc/sysmon/sysmon.xml
4545 register : sysmon_configured
46+ changed_when : false
47+
48+ - name : Check if sysmon service exists and is active
49+ become : true
50+ command : systemctl is-active sysmon.service
51+ register : sysmon_service_check
52+ changed_when : false
53+ failed_when : false
4654
4755- name : launch with config
4856 become : true
4957 ansible.builtin.shell : sysmon -accepteula -i /tmp/SysMonLinux-CatchAll.xml
50- when : not sysmon_configured.stat.exists | default(false)
58+ when : (not sysmon_configured.stat.exists | default(false)) and (sysmon_service_check.rc != 0 | default(true))
59+ changed_when : false
5160
5261- name : install powershell
5362 become : true
6473 owner : splunkfwd
6574 group : splunkfwd
6675 mode : ' 0755'
67- recurse : yes
6876 with_items :
6977 - /opt/splunkforwarder/etc/apps/sysmon_app/local/
7078
7583 dest : /opt/splunkforwarder/etc/apps/sysmon_app/local/inputs.conf
7684 owner : splunkfwd
7785 group : splunkfwd
78- mode : ' 0644'
79- force : yes
86+ mode : ' 0644'
You can’t perform that action at this time.
0 commit comments