---
- name: Capture boot and logical volume information
  hosts: all
  become: true
  gather_facts: true
  strategy: free

  vars_files:
    - bigboot_vars.yml

  tasks:
    - name: Cleanup from any previous executions
      ansible.builtin.import_tasks: tasks/cleanup.yml

    - name: Set boot device details
      ansible.builtin.import_tasks: tasks/capture_boot_device_details.yml

    - name: Set logical volume information
      ansible.builtin.import_tasks: tasks/capture_lv_device_details.yml
      when:
        - bigboot_execute_bigboot | default(false) | bool

    - name: Set environment for subsequent workflow nodes
      ansible.builtin.set_stats:
        aggregate: true
        data:
          bigboot_data: "{{ bigboot_data | default({}) |
            combine({inventory_hostname:
              {
                'bigboot_execute_bigboot': bigboot_execute_bigboot,
                'bigboot_execute_shrink_lv': bigboot_execute_shrink_lv | default(false),
                'bigboot_adjacent_lvm_device': bigboot_adjacent_lvm_device | default(omit),
                'bigboot_lv_shrink_size': bigboot_lv_shrink_size | default(0) | int,
                'bigboot_pv': bigboot_pv | default(omit),
                'bigboot_size_target': bigboot_size_target_fallback | default(bigboot_size_target),
                'ip_addresses': ansible_all_ipv4_addresses,
                'server_hostname': ansible_hostname
              }
            }) }}"

...
