From a51cb3f5d8e7864cb03019fc46ccc78ea4ecd997 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Fri, 15 Jul 2022 18:16:54 +0200 Subject: [PATCH] Add tasks for making asusctl and superfgxctl --- roles/laptop/tasks/asusctl.yml | 33 ++++++++++++++++++++++++++++++ roles/laptop/tasks/main.yml | 4 ++++ roles/laptop/tasks/supergfxctl.yml | 33 ++++++++++++++++++++++++++++++ roles/laptop/vars/main.yml | 4 ++++ 4 files changed, 74 insertions(+) create mode 100644 roles/laptop/tasks/asusctl.yml create mode 100644 roles/laptop/tasks/supergfxctl.yml create mode 100644 roles/laptop/vars/main.yml diff --git a/roles/laptop/tasks/asusctl.yml b/roles/laptop/tasks/asusctl.yml new file mode 100644 index 0000000..e94ab7b --- /dev/null +++ b/roles/laptop/tasks/asusctl.yml @@ -0,0 +1,33 @@ +- name: install required packages for asusctl + become: yes + apt: + update_cache: yes + pkg: + - rust-all + - libclang-dev + - libudev-dev + - make + +- name: checkout asusctl repo + git: + repo: "{{ asusctl.repo }}" + dest: "{{ ansible_user_dir }}/src/asusctl" + clone: yes + update: yes + +- name: build asusctl + make: + chdir: "{{ ansible_user_dir }}/src/asusctl" + +- name: install asusctl + become: yes + make: + chdir: "{{ ansible_user_dir }}/src/asusctl" + target: install + +- name: "Enable service" + ansible.builtin.systemd: + become: yes + name: asusctl + state: started + enabled: yes \ No newline at end of file diff --git a/roles/laptop/tasks/main.yml b/roles/laptop/tasks/main.yml index cdda24d..3b06788 100644 --- a/roles/laptop/tasks/main.yml +++ b/roles/laptop/tasks/main.yml @@ -1 +1,5 @@ - import_tasks: battery.yml + +- import_tasks: asusctl.yml + +- import_tasks: supergfxctl.yml diff --git a/roles/laptop/tasks/supergfxctl.yml b/roles/laptop/tasks/supergfxctl.yml new file mode 100644 index 0000000..5c9523d --- /dev/null +++ b/roles/laptop/tasks/supergfxctl.yml @@ -0,0 +1,33 @@ +- name: install required packages for supergfxctl + become: yes + apt: + update_cache: yes + pkg: + - curl + - git + - build-essential + - make + +- name: checkout supergfxctl repo + git: + repo: "{{ asusctl.repo }}" + dest: "{{ ansible_user_dir }}/src/supergfxctl" + clone: yes + update: yes + +- name: build asusctl + make: + chdir: "{{ ansible_user_dir }}/src/supergfxctl" + +- name: install asusctl + become: yes + make: + chdir: "{{ ansible_user_dir }}/src/supergfxctl" + target: install + +- name: "Enable service" + ansible.builtin.systemd: + become: yes + name: asusctl + state: started + enabled: yes \ No newline at end of file diff --git a/roles/laptop/vars/main.yml b/roles/laptop/vars/main.yml new file mode 100644 index 0000000..aa40b82 --- /dev/null +++ b/roles/laptop/vars/main.yml @@ -0,0 +1,4 @@ +asusctl: + repo: https://gitlab.com/asus-linux/asusctl.git +supergfxctl: + repo: https://gitlab.com/asus-linux/supergfxctl.git