2021-08-23 09:07:07 +00:00
|
|
|
---
|
|
|
|
#
|
|
|
|
# Example ansible playbook for installation of sysmon client on AIX.
|
2021-08-24 12:21:56 +00:00
|
|
|
# More information at: https://bitbucket.org/mnellemann/sysmon
|
2021-08-23 09:07:07 +00:00
|
|
|
#
|
|
|
|
# ansible-galaxy collection install community.general
|
2021-08-24 12:21:56 +00:00
|
|
|
# ansible-playbook -i aixhost, -u root sysmon-client-aix.yml
|
2021-08-23 09:07:07 +00:00
|
|
|
#
|
|
|
|
# NOTE: Ensure correct timezone and time
|
|
|
|
|
2021-08-24 12:21:56 +00:00
|
|
|
- name: "Install Sysmon Client and Plugins on AIX"
|
2021-08-23 09:07:07 +00:00
|
|
|
hosts: all
|
|
|
|
gather_facts: yes
|
|
|
|
vars:
|
|
|
|
server_url: http://sysmon-server:9925/metrics
|
2021-08-24 12:21:56 +00:00
|
|
|
|
2021-08-23 09:07:07 +00:00
|
|
|
tasks:
|
2021-08-24 12:21:56 +00:00
|
|
|
|
|
|
|
- name: Sysmon Client | Ensure hostname resolves
|
|
|
|
ansible.builtin.lineinfile:
|
|
|
|
path: /etc/hosts
|
|
|
|
state: present
|
|
|
|
line: "127.0.1.1 {{ ansible_hostname }}"
|
|
|
|
|
|
|
|
- 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 sysmon-client.rpm
|
|
|
|
ansible.builtin.command: /usr/bin/rpm -i --ignoreos /opt/sysmon-client.rpm
|
|
|
|
args:
|
|
|
|
creates: /opt/sysmon/client
|
|
|
|
|
|
|
|
- name: Sysmon Client | Install sysmon-plugins.rpm
|
|
|
|
ansible.builtin.command: /usr/bin/rpm -i --ignoreos /opt/sysmon-plugins.rpm
|
|
|
|
args:
|
|
|
|
creates: /opt/sysmon/plugins
|
|
|
|
|
|
|
|
- name: Sysmon Client | Create inittab entry for sysmon-client
|
|
|
|
community.general.aix_inittab:
|
|
|
|
name: sysmon
|
|
|
|
runlevel: '2'
|
|
|
|
action: respawn
|
|
|
|
command: env JAVA_HOME=/usr/java8_64 /opt/sysmon/client/bin/client -s {{ server_url }} >/tmp/sysmon.log 2>&1
|
|
|
|
state: present
|
|
|
|
become: yes
|
|
|
|
notify:
|
|
|
|
- reload inittab
|
|
|
|
|
|
|
|
handlers:
|
|
|
|
|
|
|
|
- name: reload inittab
|
|
|
|
command: init q
|