---
- name: "Write out build cache metadata"
  build_cache_manager:
      action: write_metadata
      cache_directory: "{{ cache_directory }}"
      build: "{{ build }}"

- name: "Clean up cache"
  build_cache_manager:
      action: cleanup_cache
      cache_directory: "{{ cache_directory }}"
      public_roads_candidate : "{{ public_roads_candidate }}"
  when: ansible_hostname != 'ai'
  # Deleting old cached assets on ai is now managed by the Deploy V2 cache management system
  # This build cache manager is still in use for non-ai nodes
