DevOps & Automation

Practical guides and lessons from the field.

Follow via RSS

Recent articles

2025

Articles & guides

Getting Started with Ansible Development on Windows Using WSL and Visual Studio Code

Windows Subsystem for Linux (WSL) lets you run Ansible and other Linux tools while working on a Windows desktop. Visual Studio Code (VS Code) connects to that Linux environment, so you can edit files, use Git and run commands from one editor. This guide sets up AlmaLinux 10 in WSL 2, creates a Python virtual environment and connects it to the Ansible extension in VS Code. The result is a workspace with code completion, syntax highlighting, YAML validation and linting, plus access to the Ansible command-line tools. WSL 2 runs a Linux kernel inside a lightweight virtual machine managed by Windows. You do not need to configure a separate virtual machine or dual-boot installation. See Microsoft’s comparison of WSL versions for the architectural differences. The screenshots come from the original July 2025 article. They illustrate the setup, but current extension screens and settings can differ. Use the updated commands and configuration below when following the guide. The examples use AlmaLinux 10 and its Python 3.12 packages. My preference remains AlmaLinux for its compatibility with Red Hat Enterprise Linux. Ubuntu is another option, but its package installation commands differ. You can install more than one WSL distribution. Check Python compatibility when choosing another distribution. The current ansible-dev-tools package metadata requires Python 3.11 or later, while individual tools can have stricter requirements. The ansible-core support matrix lists supported controller…

How I Write Beautiful Code in VCF Operations Orchestrator using ESLint and Prettier

I use a consistent code style for VCF Operations Orchestrator development. It makes files easier to navigate, patterns easier to identify and code easier to read. Applying industry conventions and team preferences manually can be tedious. Configured tools automate formatting and keep the codebase consistent. I use two tools: Together, these tools can detect issues such as: You can customise the rules to suit your preferences or team standards. Prettier deliberately offers fewer choices to keep formatting consistent with minimal configuration. The tools can also apply fixes automatically when you save a file. This reduces the time spent correcting formatting and syntax issues by hand. This example shows style issues the tools can detect and fix: The screenshot shows three issues: With the tools configured, saving the file corrects these issues automatically. These screenshots show Visual Studio Code, which I configure later in the post. You can get the same results from the command line, including in a CI pipeline or without an IDE. This guide uses Windows and assumes you have: Open a command prompt in the project's root directory. Run this command to install the ESLint and Prettier dependencies: Place both configuration files in the project root. These examples come from my project: After installing the dependencies and adding the configuration, run either tool from the command line. Both can check files without changing them or write automatic fixes. The following commands…

VCF Operations Orchestrator: Auto-Document Your Actions with Ease

I spend much of my time developing VCF Operations Orchestrator code. Even with a structured development process, documentation can fall behind frequent code changes. I created a script to automate the documentation. It needed to meet these requirements: The vcf-operations-orchestrator-doc-generator repository contains the tool and usage instructions. It requires code managed with Build Tools for VMware Aria in a JS-Based Actions-Only Project. The documentation tool provides the following features: If you’re not using the Build Tools, Mayank Goyal has created a tool called VRODoc that can connect to Orchestrator and document Actions in a package. If you want to document your Workflows, Josh Broadway also has a tool, vcf-automation-orchestrator-automated-workflow-documentation. ActiveDirectoryService.md documents a class and all its methods in one file. vm.md documents the com.simplygeek.vcenter.vm module. It presents each action in that module as a function. README.md provides a top-level table of contents for all generated files. The script generates documentation automatically. I can integrate it into my pipeline and publish the output to my preferred wiki. I hope this helps you automate your documentation. This is the initial release, so there may be issues. I welcome feedback and will help where I can. Please feel free to reach out with any questions or suggestions.

VCF Operations Orchestrator: Why I Write Actions and Not Workflows (Mostly)

99% of my VCF Operations Orchestrator code is written as actions. This lets me write pure JavaScript that is easier to read and maintain. It also works with linters, unit testing frameworks and code analysers. Workflows provide a visual, drag-and-drop interface for automation with little code. They were originally intended to help system administrators and infrastructure teams automate vCenter Server tasks without needing a traditional development background. This simple workflow contains small script tasks, a for each loop and error handling, shown by the red line: Orchestrator's role has changed since its first release in 2009. A platform for simple scripts and automation flows now needs to support complex solutions that integrate dozens of systems. Developers still build these solutions with the traditional workflow model. In my view, that approach no longer fits: large, complex workflows are difficult to understand, maintain and troubleshoot. This larger workflow runs a script on a virtual machine: This is a relatively tidy example compared with others I have seen. Even so, changing a large workflow can mean spending more time rearranging the visual layout than developing the solution. Workflows also store their content primarily as XML. In Git, you work with those raw files, which makes development outside the visual editor cumbersome. Large XML diffs are difficult to read and assess during peer review. A workflow's XML can contain hundreds or thousands of lines. Here…

Process locking made easy in VCF Operations Orchestrator, featuring automatic unlock

VCF Operations Orchestrator has a built-in locking semaphore provided by the LockingSystem class. When a lock is created, the workflow is placed into a waiting state, and any additional executions of the workflow will be placed in a queue until the lock is released. Locking protects data consistency by preventing multiple processes from updating the same resource at once. This matters when concurrent workflows share resources. The LockingSystem method lock attempts to acquire a lock for a given lockId and owner. It returns true if successful, or false otherwise. LockAndWait waits indefinitely if it cannot acquire a lock. I use lock instead because it allows a timeout or other corrective handling. Release an acquired lock with unlock. My LockingService extends LockingSystem with these features: You can download my LockingService module as a package here or as native JS here. Import LockingService into an action or workflow with the following code: The code creates a LockingService instance in locking. Use that variable to create and remove locks, or rename it if needed. Use these LockingService methods to create and remove locks: locking.createLock(lockOwner, lockId, retryMaxAttempts, retryDelay, autoRemoveLock) → {Boolean} Parameters: Returns a boolean. locking.removeLock(lockOwner, lockId) Parameters: Thanks for reading, and please let me know if you have any suggestions for improving this service.

Empower VCF Operations Orchestrator API integration with HttpRestClient

The HTTP-REST plugin in VCF Operations Orchestrator represents API endpoints as RestHosts in the inventory. After defining a RestHost, you can authenticate and send HTTP requests such as GET and POST to its endpoint. HttpRestClient handles common request tasks, including content types, errors and retries. HttpRestClient provides these features: HttpRestClient provides shared request handling between Orchestrator and API endpoints. It is designed to integrate with or extend any API service. You can download my HttpRestClient module as a package here or as native JS here. Import HttpRestClient into an action or workflow using one of these approaches: As a variable: As an object property: Alternatively, extend the class using classical inheritance: Parameters: The code creates an HttpRestClient instance in rest. Use this variable for API calls, or rename it if needed. Use one of the following methods to make an API call: rest.httpGet(uri, acceptType, expectedResponseCodes, headers) → {*} Parameters: Returns the request response object. rest.httpPost(uri, acceptType, content, contentType, expectedResponseCodes, headers) → {*} Parameters: Returns the request response object. rest.httpPut(uri, acceptType, content, contentType, expectedResponseCodes, headers) → {*} Parameters: Returns the request response object. rest.httpPatch(uri, acceptType, content, contentType, expectedResponseCodes, headers) → {*} Parameters: Returns the request response object. rest.httpDelete(uri,…

Logger for better Logs in VCF Operations Orchestrator

VCF Operations Orchestrator cannot dynamically include an action or sub-workflow name in console logs. The expression this.workflow.name returns the top-level workflow name, even inside sub-workflows and actions. I described my solution on SimplyGeek several years ago. I still consider it the best option and believe it avoids these logging limitations. My Logger class provides consistent logging across actions and workflows. Import it wherever you need to identify the source of a message. You can download my Logger module as a package here or as native JS here. This example uses Logger in addComputerToAD, an action that adds a computer object to Active Directory: The output identifies messages from addComputerToAD and the actions it calls, with INFO, DEBUG and WARNING log types. This makes each message's source clear and helps with troubleshooting. To import Logger, add the following code at the top of the action or workflow scriptable task: Set these two parameters: Parameters: The code creates a Logger instance in log. Use that variable to send messages, or rename it if needed. Set logName manually to the action's name. A Jasmine unit test can check this. If you rename the action, you also need to update logMessage. Across the thousands of actions I have written, this has been a minor issue. Using arguments.callee to retrieve the action name dynamically causes problems with nested actions. Use one of the following methods to send a console message: The example above…

VCF Automation – Native Git Integration vs Alternatives

Git integration with VCF Automation comes up regularly in conversations about GitHub and GitLab. Native integrations suit their intended uses, but misunderstandings about their scope can lead to disappointment. Before choosing an integration, establish which content it can manage from Git. This post explains the native options, their limitations and the alternatives you may need. VCF Automation relies on the bundled VCF Operations Orchestrator product for its full automation capabilities. Orchestrator is often overlooked because it is a separate product. The two products integrate with Git differently, so consider both. I divide the uses of Git into three categories: Each category is likely to need different tools, methods and a different lifecycle. This post focuses on Git support rather than examining orchestration tools in detail. The following tables list infrastructure configuration and content that could be stored in Git. They show which items the native integrations supported when I wrote this post. VCF Automation and VCF Operations Orchestrator have separate tables. These are the most common infrastructure configuration items: VCF Automation: VCF Operations Orchestrator: The following content is consumed by end users or supports that consumption: VCF Automation: VCF Operations Orchestrator: * Orchestrator can present and activate only one branch at a time. A typical branching strategy does not handle environment-specific content, such as configurations, by itself.…