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.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-core2.15 or later on the controller- A target host on a supported platform
- Miru Agent
v0.10.2or later - An API key with the
devices:provisionandprovisioning_tokens:writescopes
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
Use the role
Write the playbook
Write the playbook to apply the provision role to the hosts in your inventory.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.
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.2string
Device name shown in the dashboard. Defaults to the hostname of the target host.Default:
inventory_hostnamestring
Debian package architecture. The role automatically detects
amd64 or arm64.Default: auto-detectedRun the playbook
Run the playbook and pass the API key in at runtime: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 statusActivating before transitioning to Online.
The transition from
Activating to Online may take up to 10 seconds, depending on your network connection.
