62 lines
1.7 KiB
YAML
62 lines
1.7 KiB
YAML
---
|
|
#
|
|
# Example ansible playbook for installation of sysmon client on Linux (RPM based).
|
|
# More information at: https://bitbucket.org/mnellemann/sysmon
|
|
#
|
|
# ansible-playbook -i linuxhost, -u root sysmon-client-linux.yml
|
|
#
|
|
# NOTE: Ensure correct timezone and time
|
|
|
|
- name: "Install Sysmon Client and Plugins on Linux (RPM based)"
|
|
hosts: all
|
|
gather_facts: no
|
|
vars:
|
|
server_url: http://sysmon-server:9925/metrics
|
|
|
|
tasks:
|
|
|
|
- name: Sysmon Client | Copy sysmon-client.rpm
|
|
ansible.builtin.copy:
|
|
src: "{{ item }}"
|
|
dest: /opt/sysmon-client.rpm
|
|
with_fileglob:
|
|
- ../../client/build/distributions/sysmon-client-*.noarch.rpm
|
|
|
|
- name: Sysmon Client | Copy sysmon-plugins.rpm
|
|
ansible.builtin.copy:
|
|
src: "{{ item }}"
|
|
dest: /opt/sysmon-plugins.rpm
|
|
with_fileglob:
|
|
- ../../plugins/build/distributions/sysmon-plugins-*.noarch.rpm
|
|
|
|
- name: Sysmon Client | Install OpenJDK (headless)
|
|
yum:
|
|
name: "java-11-openjdk-headless"
|
|
state: present
|
|
|
|
- name: Sysmon Client | Install sysmon-client.rpm
|
|
yum:
|
|
name: /opt/sysmon-client.rpm
|
|
state: present
|
|
disable_gpg_check: true
|
|
|
|
- name: Sysmon Plugins | Install sysmon-plugins.rpm
|
|
yum:
|
|
name: /opt/sysmon-plugins.rpm
|
|
state: present
|
|
disable_gpg_check: true
|
|
|
|
- name: Sysmon Client | Create service file
|
|
template: src=sysmon-client.service.j2 dest=/lib/systemd/system/sysmon-client.service mode=644
|
|
notify:
|
|
- reload systemctl
|
|
|
|
- name: Sysmon Client | Start service
|
|
service: name=sysmon-client.service state=started enabled=yes
|
|
|
|
|
|
handlers:
|
|
|
|
- name: reload systemctl
|
|
command: systemctl daemon-reload
|