Automate Log Insight Agent Installation using SaltStack

In this blog, I would demonstrate how to automate install VMware Log Insight Agent using SaltStack. 

What is VMware Log Insight Agent? 

A Log Insight agent collects events from log files and forwards them to a vRealize Log Insight and Log Insight Cloud 

What is Saltstack?

SaltStack is built on a powerful event-driven automation engine that provides IT, devops and SRE professionals with a simple, declarative management framework for their entire global infrastructure.


Following are the pre-requisites 
  • Working Setup of Saltstack with Master and Minion
    • I have 1 Master and 1 Minion on CentOS, and I will be installing liagent on the minion
  • Log Insight Agent saved on Webserver. 
    • I will be installing LI Agent 8.2 
  • Log Insight Agent ini file (Optional, If you are going to use the default from the log insight server) 


The following section includes steps for installing LI Agent using salt stack

Step 1

Create the state file liagent.sls . You can refer to the documentation on How to use/create Salt States
      - name: sudo curl -k http://webserver/LIAgent/VMware-Log-Insight-Agent-8.2.0-16776561.rpm --output /tmp/VMware-Log-Insight-Agent-8.2.0-16776561.rpm
      - name: sudo rpm -i /tmp/VMware-Log-Insight-Agent-8.2.0-16776561.rpm
      - name: sudo curl -k http://webserver/LIAgent/liagent.ini --output /var/lib/loginsight-agent/liagent.ini
      - name: sudo systemctl restart liagentd     

Step 2 

Test execute of the state file and ensure it succeeds 
salt  state.sls liagent test

Step 3

Apply the state file to the minion
salt  state.sls liagent
If you want to push it to all the minions that you can just use the following
salt \'*\' state.sls liagent

Step 4

Verify liagent on the minion
systemctl status liagentd

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: