---
- name: install nvidia-modprobe on ubuntu
  package:
    name: nvidia-modprobe
    state: present
  become: true
  when: ansible_os_family == 'Debian'

- name: Copy Files
  become: true
  become_user: root
  copy:
   src: "{{ item.src }}"
   dest: "{{ item.dest }}"
   owner: root
   mode: 0755
  with_items:
   - { src: 'create-dev-uvm.sh', dest: '/usr/local/sbin/' }
   - { src: 'check-dev-uvm.sh', dest: '/usr/local/sbin/' }
   - { src: 'create-dev-uvm.service', dest: '/etc/systemd/system/' }

- name: Enable Service
  become: true
  become_user: root
  systemd: enabled=yes state=started name=create-dev-uvm
