- name: Retrieve billing data using custom python script
  vars:
    output_file: "ibm_billing_metrics_{{ item }}.json"
    tag_key: "tag"
    tag_value: "{{ item }}-{{ tag_uuid }}"
  ansible.builtin.command:
    cmd: python3 files/fetch_billing_data_ibm.py --tag_key '{{ tag_key }}' --tag_value '{{ item }}-{{ tag_uuid }}' --api_key '{{ IBM_CLOUD_TOKEN }}' --output_file '{{ output_file }}' -- '{{ IBM_CLOUD_ACCOUT_ID }}'
  register: billing_data
  loop:
    - karpenter
    - cas
  