Ansible playbook for easy install on AIX, and dependency updates.

This commit is contained in:
Mark Nellemann 2021-08-23 11:07:07 +02:00
parent 3dd568a95e
commit e2b478a1c2
11 changed files with 93 additions and 13 deletions

View File

@ -5,7 +5,7 @@ subprojects {
maven { url("https://plugins.gradle.org/m2/") }
}
dependencies {
classpath 'org.redline-rpm:redline:1.2.9'
classpath 'org.redline-rpm:redline:1.2.10'
}
}

View File

@ -5,7 +5,7 @@ plugins {
id "com.github.johnrengelman.shadow" version "7.0.0"
id "net.nemerosa.versioning" version "2.14.0"
id "nebula.ospackage" version "8.5.6"
id "nebula.ospackage" version "8.6.1"
}
dependencies {

View File

@ -82,4 +82,5 @@ public class ClientRouteBuilder extends RouteBuilder {
}
}

View File

@ -0,0 +1,48 @@
---
#
# 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

View File

@ -0,0 +1,35 @@
---
#
# Example ansible playbook for timezone and NTP setup on AIX.
# A reboot is required for the timezone change.
#
# ansible-galaxy collection install community.general
# ansible-playbook -i aixhost, -k -u root timezone-aix.yml
#
- name: "Install / Configure sysmon client and plugins"
hosts: all
gather_facts: yes
vars:
timezone: Europe/Copenhagen
ntp_server: dk.pool.ntp.org
tasks:
- name: Configure timezone
ansible.builtin.replace:
path: /etc/environment
regexp: '^TZ=(.*)$'
replace: "TZ={{ timezone }}"
- name: Update time from NTP server
ansible.builtin.command: /usr/sbin/ntpdate {{ ntp_server }}
- name: Create cron entry for updating time periodically
ansible.builtin.cron:
name: ntpdate
weekday: "*"
minute: "1"
hour: "*"
user: root
job: "/usr/sbin/ntpdate {{ ntp_server }}"

View File

@ -1,6 +1,6 @@
version=0.0.6
pf4jVersion=3.6.0
slf4jVersion=1.7.31
slf4jVersion=1.7.32
camelVersion=3.11.0
picocliVersion=4.6.1
oshiVersion=5.7.5
oshiVersion=5.8.1

View File

@ -1,7 +1,7 @@
import org.redline_rpm.header.Os
plugins {
id "nebula.ospackage" version "8.5.6"
id "nebula.ospackage" version "8.6.1"
}

View File

@ -1,7 +1,5 @@
pluginId=sysmon-base
pluginClass=sysmon.plugins.os_base.BasePlugin
pluginVersion=0.0.1
pluginProvider=System Monitor
pluginDependencies=
pluginDescription=Base OS metrics where supported.

View File

@ -1,6 +1,4 @@
pluginId=sysmon-ibmi
pluginClass=sysmon.plugins.os_ibmi.IbmIPlugin
pluginVersion=0.0.1
pluginProvider=System Monitor
pluginDependencies=
pluginDescription=Collects IBM-i OS metrics.

View File

@ -5,7 +5,7 @@ plugins {
id "com.github.johnrengelman.shadow" version "7.0.0"
id "net.nemerosa.versioning" version "2.14.0"
id "nebula.ospackage" version "8.5.6"
id "nebula.ospackage" version "8.6.1"
}
dependencies {

View File

@ -17,9 +17,9 @@ repositories {
}
dependencies {
testImplementation 'org.codehaus.groovy:groovy:3.0.7'
testImplementation 'org.spockframework:spock-core:2.0-M4-groovy-3.0'
testImplementation 'junit:junit:4.13.1'
testImplementation 'org.codehaus.groovy:groovy:3.0.8'
testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0'
testImplementation 'junit:junit:4.13.2'
testImplementation "org.slf4j:slf4j-api:${slf4jVersion}"
implementation "org.slf4j:slf4j-api:${slf4jVersion}"