#!/usr/bin/env ansible-playbook
---
#==============================================================#
# File      :   deepflow.yml
# Desc      :   deploy deepflow stack with three dedicated roles
# Ctime     :   2026-02-04
# Mtime     :   2026-02-04
# Path      :   deepflow.yml
# License   :   Apache-2.0 @ https://pigsty.io/docs/about/license/
#==============================================================#

- name: DEEPFLOW STACK
  become: true
  hosts: all
  gather_facts: no

  roles:
    - { role: node_id               , tags: node-id,               when: deepflow_enabled | default(true) | bool }
    - { role: deepflow_mysql        , tags: deepflow_mysql,        when: deepflow_mysql_enabled | default(true) | bool }
    - { role: deepflow_clickhouse_s3, tags: deepflow_clickhouse_s3, when: deepflow_clickhouse_s3_enabled | default(true) | bool }
    - { role: deepflow_server       , tags: deepflow_server,       when: deepflow_enabled | default(true) | bool }
    - { role: deepflow_connector    , tags: deepflow_connector,    when: deepflow_connector_enabled | default(false) | bool }
    - { role: deepflow_agent        , tags: deepflow_agent,        when: deepflow_agent_enabled | default(false) | bool }

# Usage:
# 1. Define deepflow group in pigsty.yml
# 2. Ensure docker is installed: ./docker.yml
# 3. Run ./deepflow.yml -l <deepflow_group>
