VMware Aria Automation and SaltStack Config Resource
How to start using the SaltStack Config Resource with VMware Aria Automation Cloud Templates.
Use Case
VMware Aria Automation Config has been the Configuration Management tool that I like to use with Servers, Windows and Linux. The first process to use salt with new servers is to install the salt minion, which is an agent that needs installed on the Server. There are many different ways to install the salt minion agent and what I wanted to show in this blog post is how to use the SaltStack Config Resource with the VMware Automation Cloud Template. When creating a Cloud Template in VMware Aria Automation, one of the options is to add the SaltStack Config Resource.
What the SaltStack Config Resource provides:
- Automated Salt minion installation
- Ability to add grains data to minion when the minion installation completes. See example yaml code.
- The minion key is auto-accepted in SaltStack Config
- If you delete the VM deployment in VMware Aria Automation, the minion key will be automatically removed from VMware Aria Automation Config. Built-in decommission.
- Ability to run a state file when the minion installation completes. See example yaml code.
Requirements:
- This blog was created using VMware Aria Automation version 8.11.0. The process may vary for different version of VMware Aria Automation.
- TCP Port 445 needs to be open between VMware Aria Automation Config server and the new Server that the minion is being installed on.
- Check the VMware Aria Automation Config server. The OS that you are using for the new server must have an agent file in the /etc/salt/cloud.deploy.d folder.
- Check the VMware Aria Automation Config server. The version of the agent files in the /etc/salt/cloud.deploy.d folder must match the version of the salt master.
- The script that creates the grains file when using the SaltStack Config Resource and VMware Aria cloud templates with Windows Servers needs to be manually replaced on the VMware Aria Automation Config Server (salt master). Future VMware Aria Automation Config installs with LCM (VMware Aria Suite LifeCycle) will include this fix. The script creates the grains file in the incorrect folder.
- Location of script on salt master: /lib64/python3.7/site-packages/salt/utils/cloud.py
- Make a copy of the original cloud.py before replacing with updated version.
- Where to get new script: https://github.com/saltstack/salt/blob/master/salt/utils/cloud.py
- The grains file will be created in “C:\ProgramData\Salt Project\Salt\conf” after the script is updated.
- Update: When I installed VMware Aria Automation Config 8.12, 8.13 and 8.14 I still needed to update the cloud.py file for the grains to be created properly.
Current OS support:
Any OS not listed is currently not supported at this time.
Cloud Template | Windows 2019 Server:
- Windows 2019 Server cloud template yaml code:
- You MUST add the remoteAccess code in the Virtual_Machine section for minion installation.
- grains data is added in the additionalMinionParams section of the yaml code.
- When the minion agent installation is complete, you will see the new minion listed in the targets automatically. You do not need to accept the minion key.
- click to expand yaml code
|
|
Cloud Template | Ubuntu 20 Server:
- Ubuntu 20 Server cloud template yaml code:
- You MUST add the remoteAccess code in the Virtual_Machine section for minion installation.
- grains data is added in the additionalMinionParams section of the yaml code.
- When the minion agent installation is complete, you will see the new minion listed in the targets automatically. You do not need to accept the minion key.
- click to expand yaml code
|
|
- This screen shot shows how to get the “masterId” to use in the Cloud Template yaml code.
- This screen shot shows how to see the SaltMaster version.
Completed Deployment
- This shows what the deployment looks like after it is completed.
- Grain data is shown within the Salt Configuration section.
Custom Form to create the Windows Server Deployment
- Example of a Custom Form for Windows Server Builds
Lessons Learned
- See “Requirements” listed above
- See “What the SaltStack Config Resource provides” above
- If you need to update the minion agent files on the salt master server, in folder /etc/salt/cloud.deploy.d, you will have to have your VMware account team download the files for you or open an SR. The files are not public facing.
Helpful Links
When I write about VMware Aria Automation, I always say there are many ways to accomplish the same task. VMware Aria Automation Config is the same way. I am showing what I felt was important to see but every organization/environment will be different. There is no right or wrong way to use Salt. This is a GREAT Tool that is included with your VMware Aria Suite Advanced/Enterprise license. If you own the VMware Aria Suite, you own VMware Aria Automation Config.
- VMware Aria Automation = vRealize Automation
- VMware Aria Automation Config = SaltStack Config
- If you like wearing Crocs and want to get a pair like I wear, follow this link to Amazon: My Favorite Crocs
- If you found this Blog article useful and it helped you, Buy me a coffee to start my day.