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

48 lines
1.6 KiB
YAML
Raw Normal View History

---
#
# Example ansible playbook for installation of sysmon client on AIX.
#
# ansible-galaxy collection install community.general
# ansible-playbook -i aixhost, -k -u root sysmon-client.yml
#
# NOTE: Ensure correct timezone and time
- name: "Install / Configure sysmon client and plugins"
hosts: all
gather_facts: yes
vars:
client_download_url: https://bitbucket.org/mnellemann/sysmon/downloads/sysmon-client-0.0.5-1.noarch.rpm
plugins_download_url: https://bitbucket.org/mnellemann/sysmon/downloads/sysmon-plugins-0.0.5-1.noarch.rpm
server_url: http://sysmon-server:9925/metrics
client_hostname: myaix
tasks:
- name: Download sysmon-client
get_url:
url: "{{ client_download_url }}"
dest: /opt/sysmon-client.rpm
- name: Download sysmon-plugins
get_url:
url: "{{ plugins_download_url }}"
dest: /opt/sysmon-plugins.rpm
- name: Install sysmon-client (if /opt/sysmon/client does not exist)
ansible.builtin.command: /usr/bin/rpm -i --ignoreos /opt/sysmon-client.rpm
args:
creates: /opt/sysmon/client
- name: Install sysmon-plugins (if /opt/sysmon/plugins does not exist)
ansible.builtin.command: /usr/bin/rpm -i --ignoreos /opt/sysmon-plugins.rpm
args:
creates: /opt/sysmon/plugins
- name: 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 }} -n {{ client_hostname }} >/tmp/sysmon.log 2>&1
state: present
become: yes