# This should run on all main-ai and vision, except compute 2.5 vision
- block:

  - name: Copy log disk script
    copy:
      src: "handle_disk_action.sh"
      dest: "/etc/zoox/scripts/"
      owner: root
      group: root
      mode: 0755

  - name: Install udev rules for main-ai logging disks
    copy:
      src: "90-log-disk.rules"
      dest: "/etc/udev/rules.d/"
      owner: root
      group: root
      mode: 0644

  - name: Set the dangling mountpoint template variable
    set_fact:
      dangling_mountpoints_pattern: "{{ 'zooxdata' if zoox_compute_version is version('2.5', '=') else 'zooxusb' }}"

  - name: Install the upstart script for cleaning dangling mount
    template:
      src: "dangling-mountpoints-cleanup.conf.j2"
      dest: "/etc/init/dangling-mountpoints-cleanup.conf"
      owner: root
      group: root
      mode: '644'

  - name: Enable cleaning dangling mount upstart script
    service:
      name: dangling-mountpoints-cleanup
      enabled: true
      state: stopped

  become: yes
