---

- name: Finalize the set of meteringconfig static dictionaries
  set_fact:
    meteringconfig_default_values: "{{ meteringconfig_default_values }}"
    meteringconfig_spec_overrides: "{{ meteringconfig_spec_overrides }}"
  no_log: true

- name: Validate Configurations
  include_tasks: validate.yml

- name: Configure Networking
  include_tasks: configure_networking.yml

- name: Configure Storage
  include_tasks: configure_storage.yml

- name: Configure TLS
  include_tasks: configure_tls.yml

- name: Configure Reporting
  include_tasks: configure_reporting.yml

- name: Configure Hive Metastore
  include_tasks: configure_hive_metastore.yml

- name: Finalize the set of overall meteringconfig values
  set_fact:
    meteringconfig_spec: "{{ meteringconfig_spec }}"
  no_log: true

- name: Store MeteringConfig spec into values file
  copy: content="{{ meteringconfig_spec }}" dest=/tmp/metering-values.yaml

- include_tasks: "{{ item }}"
  loop:
    - reconcile_metering.yml
    - reconcile_monitoring.yml
    - reconcile_hdfs.yml
    - reconcile_hive.yml
    - reconcile_presto.yml
    - reconcile_reporting_operator.yml
    - reconcile_reporting.yml
