sysmon/doc/ansible/sysmon-client-aix.yml

64 lines
1.9 KiB
YAML

---
#
# Example ansible playbook for installation of sysmon client on AIX.
# More information at: https://bitbucket.org/mnellemann/sysmon
#
# ansible-galaxy collection install community.general
# ansible-playbook -i aixhost, -u root sysmon-client-aix.yml
#
# NOTE: Ensure correct timezone and time
- name: "Install Sysmon Client and Plugins on AIX"
hosts: all
gather_facts: yes
vars:
server_url: http://sysmon-server:9925/metrics
tasks:
- 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