Skip to main content
The official Ansible collection installs the Miru Agent debian package and provisions the target host in Miru. The collection only supports Miru Agent versions v0.10.2 or later. To provision an earlier version of the Miru Agent, use a different provisioning method.

What it does

The Ansible collection installs the Miru Agent debian package and provisions the target host in Miru. It is the provisioning-token flow packaged as a role: the API key stays on the Ansible controller, and only a short-lived token reaches each device. Provision role control flow: install or upgrade, skip if already provisioned, create a token, create the device in Miru if needed, then activate Provision role control flow: install or upgrade, skip if already provisioned, create a token, create the device in Miru if needed, then activate Miru matches miru_device_name (default inventory_hostname). If a device with that name doesn’t exist, is created and activated in Miru. If that device has been created in Miru but not yet activated (has state inactive), then the device is activated.

Requirements

  • ansible-core 2.15 or later on the controller
  • A target host on a supported platform
  • Miru Agent v0.10.2 or later
  • An API key with the devices:provision and provisioning_tokens:write scopes

Install the collection

The collection is available on GitHub. Support for Ansible Galaxy is coming soon. Install the collection on the Ansible controller:
requirements.yml
You can also install a release tarball.

Use the role

Write the playbook

Write the playbook to apply the provision role to the hosts in your inventory.
Be sure to set the hosts variable to your inventory group. We recommend passing miru_api_key at run time, which is why it isn’t included in the snippet above.
miru_agent_version is required and must be 0.10.2 or later.

Role variables

string
required
Platform API key used to mint provisioning tokens. This secret remains on the Ansible controller.
string
required
Miru Agent version to install. The version must be 0.10.2 or later.Use latest to install the newest available package on every run.Example: 0.10.2
string
Device name shown in the dashboard. Defaults to the hostname of the target host.Default: inventory_hostname
string
Debian package architecture. The role automatically detects amd64 or arm64.Default: auto-detected

Run the playbook

Run the playbook and pass the API key in at runtime:
Ansible Vault or a CI secret store also work for storing the API key. Never commit a plaintext key.

Verify

To verify the Miru Agent was successfully installed and provisioned in Miru, navigate to the Devices page. You should see the device listed with the status Activating before transitioning to Online.
The transition from Activating to Online may take up to 10 seconds, depending on your network connection.
Last modified on September 7, 2026