In this blog, I would demonstrate how to automate install VMware Log Insight Agent using SaltStack.
What is VMware Log Insight Agent?
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
Create the state file liagent.sls . You can refer to the documentation on How to use/create Salt States
copy-liagent-rpm: cmd.run: - 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.rpminstall-liagent: cmd.run: - name: sudo rpm -i /tmp/VMware-Log-Insight-Agent-8.2.0-16776561.rpmcopy-liagentconfig: cmd.run: - name: sudo curl -k http://webserver/LIAgent/liagent.ini --output /var/lib/loginsight-agent/liagent.inirestart-liagentd: cmd.run: - name: sudo systemctl restart liagentd
Test execute of the state file and ensure it succeeds
salt state.sls liagent test
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
Verify liagent on the minion
systemctl status liagentd