From 3859fffd60164febbaacc2f68b045d3b0d07f3d6 Mon Sep 17 00:00:00 2001 From: wep21 Date: Mon, 8 Feb 2021 14:33:01 +0900 Subject: [PATCH] Install kvaser library from origin Signed-off-by: wep21 --- ansible/localhost-setup-ubuntu20.04-devpc.yml | 3 ++- ansible/roles/kvaser/.gitignore | 1 + ansible/roles/kvaser/defaults/main.yml | 2 ++ ansible/roles/kvaser/tasks/main.yml | 21 +++++++++++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 ansible/roles/kvaser/.gitignore create mode 100644 ansible/roles/kvaser/defaults/main.yml create mode 100644 ansible/roles/kvaser/tasks/main.yml diff --git a/ansible/localhost-setup-ubuntu20.04-devpc.yml b/ansible/localhost-setup-ubuntu20.04-devpc.yml index 7f875072..1cca655a 100644 --- a/ansible/localhost-setup-ubuntu20.04-devpc.yml +++ b/ansible/localhost-setup-ubuntu20.04-devpc.yml @@ -17,5 +17,6 @@ - { role: tensorrt, when: yn_gpu == 'y' } - { role: ros2, rosdistro: foxy } - { role: autoware, rosdistro: foxy } - - { role: pacmod, rosdistro: foxy } # Temporary for ros2 porting + - { role: kvaser } + # - { role: pacmod, rosdistro: foxy } # Temporary for ros2 porting # - { role: ros, release: melodic } diff --git a/ansible/roles/kvaser/.gitignore b/ansible/roles/kvaser/.gitignore new file mode 100644 index 00000000..5e933d97 --- /dev/null +++ b/ansible/roles/kvaser/.gitignore @@ -0,0 +1 @@ +linuxcan* diff --git a/ansible/roles/kvaser/defaults/main.yml b/ansible/roles/kvaser/defaults/main.yml new file mode 100644 index 00000000..4e45980b --- /dev/null +++ b/ansible/roles/kvaser/defaults/main.yml @@ -0,0 +1,2 @@ +--- +version: "latest" diff --git a/ansible/roles/kvaser/tasks/main.yml b/ansible/roles/kvaser/tasks/main.yml new file mode 100644 index 00000000..a18f438c --- /dev/null +++ b/ansible/roles/kvaser/tasks/main.yml @@ -0,0 +1,21 @@ +- name: kvaser (download library) + become: no + get_url: + url: "https://www.kvaser.com/download/?utm_source=software&utm_ean=7330130980754&utm_status={{ version }}" + dest: "{{ role_path }}" + +- name: kvaser (unarchive library) + ansible.builtin.unarchive: + src: "{{ role_path }}/linuxcan.tar.gz" + dest: "{{ role_path }}" + remote_src: yes + +- name: kvaser (build the default target) + make: + chdir: "{{ role_path }}/linuxcan" + +- name: kvaser (Run install target as root) + make: + chdir: "{{ role_path }}/linuxcan" + target: install + become: yes