- 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/scripts/fetch_billing_data_ibm.py --tag_value '{{ item }}-{{ tag_uuid }}' --api_key '{{ IBM_CLOUD_TOKEN }}' --output_file '{{ output_file }}' --account_id '{{ IBM_CLOUD_ACCOUT_ID }}'
  register: billing_data
  loop:
    - karpenter
    - cas
  