- name: Setup rotation stage permissions
  become: yes
  copy:
    src: "50-arcus.rules"
    dest: "/etc/udev/rules.d/50-arcus.rules"
    owner: root
    group: root
    mode: 0644

- name: Rename Arduino driver
  become: yes
  copy:
    src: "51-arduino.rules"
    dest: "/etc/udev/rules.d/51-arduino.rules"
    owner: root
    group: root
    mode: 0644

- name: Verify framegrabber is connected
  become: yes
  shell: lspci | grep Xilinx | wc -l
  register: framegrabber_onboard

- block:
    - copy:
        src: "60-xdma.rules"
        dest: "/etc/udev/rules.d/60-xdma.rules"
        owner: root
        group: root
        mode: 0644
    - copy:
        src: "xdma-udev-command.sh"
        dest: "/etc/udev/rules.d/xdma-udev-command.sh"
        owner: root
        group: root
        mode: 0644
  become: yes
  when: framegrabber_onboard.stdout > "0"

