Deploy digital ocean agent via ansible

Posted: 2020-09-16

Digital Ocean provide a metrics agent that you can install to provide metrics that can be displayed on their dashboard.

It is currently setup by downloading an install script from

The script does provide support for detecing apt vs yum etc - but I only need the apt version.

I try to keep my droplets provisioned by ansible - so for debian at least the following ansible snippet works fine.

- name: add apt key
    state: present

- name: add repository
    repo: deb main main
    filename: digitalocean-agent
    state: present

- name: install agent
    pkg: do-agent
    state: present