Ansible role for deploying Trustee Guest Components using Podman Quadlets for confidential virtual machine deployments. The role downloads quadlet files and configuration files from a GitHub repository, installs them, and manages them as systemd services. The role also supports optional disk encryption functionality for securing additional storage devices.
The role will:
- Install Podman and Git if not already present
- Download Trustee Guest Components quadlet files and config files from the specified GitHub repository
- Copy quadlet files (
.container,.volume,.network,.kube) to the install directory (/etc/containers/systemdby default) - Copy config files from the repository's
configsdirectory to/etc/trustee-gc/ - Replace
KBS_URLandKBS_CERTplaceholders in/etc/trustee-gc/cdh/config.tomlwith the values fromcvm_deploy_trustee_kbs_urlandcvm_deploy_trustee_kbs_certvariables (if provided) - Reload systemd daemon
- Enable and start the Trustee Guest Components services
- (Optional) If
cvm_deploy_encrypt_diskistrue:- Find an unpartitioned and unmounted disk
- Create a GPT partition table and partition on the disk
- Generate an encryption key and encrypt the partition using LUKS
- Format the encrypted partition with ext4
- Mount the encrypted disk at the specified mount point
- Store the encryption key in the
encrypted_disk_keyfact
Example of setting the variables:
cvm_deploy_quadlet_repo_url: "https://github.com/litian1992/trustee-gc-quadlet-rhel"
cvm_deploy_quadlet_repo_path: "quadlet"
cvm_deploy_quadlet_repo_branch: "main"
cvm_deploy_trustee_kbs_url: "https://kbs.example.com"
cvm_deploy_trustee_kbs_cert: "/path/to/cert.pem"
cvm_deploy_encrypt_disk: trueIf disk encryption is enabled (cvm_deploy_encrypt_disk: true), this fact
contains the base64-encoded encryption key for the encrypted disk. This key is
required to mount the encrypted disk after a reboot. The key is automatically
generated during disk encryption and should be securely stored for future use.
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- name: Deploy Trustee Guest Components using Podman Quadlets
hosts: all
vars:
cvm_deploy_quadlet_repo_url: "https://github.com/litian1992/trustee-gc-quadlet-rhel"
cvm_deploy_quadlet_repo_path: "quadlet"
cvm_deploy_quadlet_repo_branch: "main"
cvm_deploy_trustee_kbs_url: "https://kbs.example.com"
cvm_deploy_trustee_kbs_cert: "/path/to/kbs-cert.pem"
cvm_deploy_encrypt_disk: true
roles:
- linux-system-roles.cvm_deployWhenever possible, please prefer MIT.
An optional section for the role authors to include contact information, or a website (HTML is not allowed).