This playbook installs D2 using the official install script.
- name: Install D2
hosts: d2_hosts
become: true
tasks:
- name: Install curl dependency
ansible.builtin.package:
name: curl
state: present
- name: Install D2 CLI
ansible.builtin.shell: |
set -euo pipefail
curl -fsSL https://d2lang.com/install.sh | sh -s --
args:
executable: /bin/bash
changed_when: false
- name: Verify D2 installation
ansible.builtin.command: d2 --version
changed_when: false