Categories
vRealize Automation

Code Stream Pipeline Execution Schedule Trigger

We are using vRealize Code Stream to automate some Tasks admins need to routinely do. Last week I ran into an Issue whereby we needed to trigger a pipeline on a Schedule. There are 3 options available natively to trigger pipeline executions but none of then would work for us. I initially thought of using Github Actions to trigger the pipeline thru a webhook but as we are running Code Stream on Prem this ended up and not being possible as detailed in this Blog post.

In the end there were 2 options to do this outside of CodeStream

Cronjob to trigger execution thru the API or using Orchestrator to do the same. Trying to reduce outside dependencies the below was what I ended up using.

The Bundled Action and Code is available here.

vRealize Orchestrator Schedule Action

I firstly created a new Orchestrator Action to trigger a specific pipeline UUID thru the Code Stream API. For this to work I needed to create the Action outside of Orchestrator due to the requirement to use the requests module. I then bundled the libraries needed with the code into a zip file and import it into orchestrator.

The Action require 4 Named Input variables to function.

  •   vRealizeApplianceURL = FQDN of vRealize Automation Appliance (https://fqdn).
  •   codestreamUserName = Username for vRealize Automation.
  •   codestreamPassword = Password for the user (SecureString).
  •   pipelineUUID = UUID of the pipeline to execute. Obtained from the URL in GUI.

With the action Imported we can go ahead and create a simple workflow which we will be able to schedule.

vRealize Orchestrator Schedule Workflow

For the Workflow I created a bunch of Variables needed by the Action. I created multiple values for the UUID input to allow me to trigger multiple pipelines in every scheduled run.

In the workflow Schema I added a Action element for each Pipeline I would like to trigger. In each element I supply all the details and the variable assigned with the pipeline that needs to be triggered. The only Variable that differ will be for the Pipeline UUID.

The last part is to create the Schedule.

Workaround till we get Native Support

This is not the ideal solution but should work until we get some native support for Timed Triggers in Code Stream.

Categories
HomeLab

Homelab – Services and Software

In the final installment of this series I would like to go thru some of the software used in my homelab and how they are used.

The following few posts I will go thru the Setup and Building of all the solutions mentioned here.

I started with ESXi 7U2 deployed on all 4 of my Hosts. My host used as a Management cluster will host the below.

  • Windows 10 VM: Used as a Jump Box to manage my lab from. All the software and tools will be installed here. everything can be done from my Laptop as well but I prefer this route to keep my lab portable / standard even when my own tools change.
  • Windows Server 2022: This will be my primary Active Directory Server. DNS will also run on this DC.
  • Windows Server 2022: This is used as my Microsoft Certificate Authority
  • Virtual Center Server Appliance: Virtual Center to manage my Lab from.

All 3 servers are hosted on the internal SSD and set to Auto start on host startup.

I then Setup my Synology NAS. I used 4 x 4TB WD Red Drives configured in RAID10. My NAS Hosts the below Services

  • NTP for my LAB
  • iSCSI Storage for VM’s
  • NFS used for Kubernetes and also ISO images. I also have a NFS Share which Hosts the VMware Content Library.
  • Active Backup for Business used for backups of All Critical VM’s.
  • Web Server Used for distribution my Proxy .wpad file.
  • Internet Proxy Server

Next up was the 3 Node vSAN Cluster, Also using ESXi 7U2. these were added to my virtual center using dns names.

I moved all networking to two separate Virtual Distributed Switches one used for normal traffic and the second for vsan.

Now it was time to get some redundancy up for my Domain controller adding a second Windows 2022 server.

At this point we have all the core components in place to start building our business. Initially I will also, at this point, build myself a few Templates for Ubuntu and Server 2022 just to make my life easier later on, I will in a later post show how this can be automated.

To make the lab more functional I need some additional tools. First of which would be VMware Lifecycle manger to assist with the deployments of all other tools. I then Go ahead from there to deploy;

  • vRealize Operations manager – Monitoring and Troubleshooting
  • vRealize Log Insight – Central Log Management
  • vRealize Automation – Automating everything
  • vRealize Saltstack Config – Configuration Management for servers

Once vRealize Automation is setup and usefull I deployed 6 Ubuntu VM’s to be be used as Docker hosts for the below

  • Services Host:
    • Portainer for Docker Management GUI
    • UptimeKuma for Internet and Services Monitoring
  • NGINX Proxy Manager for reverse Proxy and SSL Certs
  • Harbor Container Registry

The other 3 Docker VM’s are used to play around with different applications

And finally time to get some Kubernetes Clusters up. I used Ranchers K3s to build a 3 Node cluster for “testing” and also spun up a Tanzu Community Edition cluster for “testing”.

That is my Homelab. It should allow for any testing I need to do for Work or Home use. I use various Tools at different times as I learn new things or hear about a project I find interesting. If this was a Business it would be ready to get departments to deploy their applications. There are still security tools missing and few tools used in Enterprises which does not make sense for me to run in my Homelab due to their massive resource requirements or dependencies.

Exit mobile version