-
Inventory defines which hosts to target (e.g., the
hostsgroup containing your physical Mac machines) - Tasks specify actions to perform (deploy VM, install software, configure settings)
- Variables customize behavior for different environments or use cases
- Handlers respond to changes (restart services after configuration updates)
Core Ansible Playbook Examples
VM Deploy
Delete a single VM
Delete multiple VMs matching a specific naming convention
-
Use
create_image.ymlto create versioned images - Store images in your OCI registry
- To restore: Deploy new VMs from the backed-up image version
- Deletes VM from Orka Engine
- Frees up resources on host
Create a VM Image
-
Place your configuration scripts (VDA install, etc.) in the
/scriptsdirectory - Scripts will be executed in alphabetical order
- Example scripts:
Cache a VM Image
pull_image.yml automatically caches the image on all hosts in the inventory.
Recreate a VM Image
This implementation doesn’t have a dedicated playbook. To refresh VMs with a new image:- Delete existing VM
- Create a new VM from specified image
Provision User to VM
Provisions a new admin user account on a running VM. The playbook connects to the VM via the Mac host as a jump proxy, sosshpass must be installed on the Ansible runner. Apple Command Line Tools will be installed on the VM automatically if not already present.
Install Citrix VDA
Installs Citrix Virtual Delivery Agent on a running VM. The playbook locates the VM across all hosts, installs prerequisites (.NET runtime, developer tools), sets the VM hostname, downloads and installs the Citrix VDA package, grants required TCC permissions, then reboots the VM to complete installation.sshpass must be installed on the Ansible runner. We recommend hosting your Citrix VDA installer in an S3 bucket with a presigned URL.
vm_name— the exact name of the running VM (also used as the VM hostname)citrix_installer_url— download URL for the Citrix VDA.dmghostname_suffix— domain suffix appended tovm_nameto form the full hostname (e.g.corp.example.com). Leave blank to use the VM name as the hostname.
Register Citrix VDA
Registers an installed Citrix VDA with a Delivery Controller using an enrollment token. Run this afterinstall_citrix_vda.yml has completed successfully.
Playbook customization for your environment
The Ansible playbook examples referenced throughout this document will require additional customization to match your infrastructure and organizational requirements. Environment-specific variables: Create agroup_vars/all.yml file with the following settings as an example:
Test Basic VM Lifecycle Operations
Before deploying to production, validate all playbook operations in a test environment.Test sequence:
- Test connectivity
- Test image operations
- Test VM deployment
- Test VDA registration
- Test VM lifecycle
- Test image creation
- Test VM recreation
- Test VM deletion
- Test end-to-end user sessions
- Use verbose output for troubleshooting:

