- hosts:
    - cldr-staging.unicode.org
    - st.unicode.org
  become: yes
  vars_files:
    - vars/main.yml
    - local-vars/local.yml
  roles:
    - { role: datadog.datadog, become: yes }
  vars:
    datadog_api_key: "{{ dd_key }}"
    datadog_site: "{{ dd_site }}"
    datadog_apm_instrumentation_enabled: "host"  # docker not installed else 'all'
  tasks:
    - name: Update datadog.yaml for apm/env
      blockinfile:
        path: /etc/datadog-agent/datadog.yaml
        block: |
          # enable apm and set the env
              enabled: true
              env: {{ dd_env }}
        marker: '# {mark} ANSIBLE MANAGED BLOCK'
        insertafter: '^apm_config:'
