Add tasks for XPS13
This commit is contained in:
parent
eb9f176046
commit
35ca98a742
13
roles/laptop/tasks/asus-x13-flow.yml
Normal file
13
roles/laptop/tasks/asus-x13-flow.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
- name: Check if it's laptop
|
||||||
|
stat:
|
||||||
|
path: /sys/class/power_supply/BAT0/charge_control_end_threshold
|
||||||
|
register: battery_limiter_available
|
||||||
|
|
||||||
|
- name: Powersave tasks
|
||||||
|
import_tasks: powersave.yml
|
||||||
|
|
||||||
|
- when: battery_limiter_available.stat.exists
|
||||||
|
block:
|
||||||
|
- import_tasks: battery.yml
|
||||||
|
- import_tasks: asusctl.yml
|
||||||
|
- import_tasks: supergfxctl.yml
|
72
roles/laptop/tasks/dell-xps13.yml
Normal file
72
roles/laptop/tasks/dell-xps13.yml
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
- become: yes
|
||||||
|
block:
|
||||||
|
- name: Create temporary directory
|
||||||
|
ansible.builtin.tempfile:
|
||||||
|
state: directory
|
||||||
|
register: tmp_dir
|
||||||
|
|
||||||
|
- name: add ppa
|
||||||
|
apt_repository:
|
||||||
|
repo: ppa:oem-solutions-engineers/oem-projects-meta
|
||||||
|
|
||||||
|
- name: install drivers
|
||||||
|
become: yes
|
||||||
|
apt:
|
||||||
|
update_cache: yes
|
||||||
|
state: latest
|
||||||
|
pkg:
|
||||||
|
- oem-somerville-tentacool-meta
|
||||||
|
|
||||||
|
- name: Create temp dir
|
||||||
|
file:
|
||||||
|
path: "{{ tmp_dir.path }}"
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: download dell configure
|
||||||
|
unarchive:
|
||||||
|
src: https://dl.dell.com/FOLDER09518608M/1/command-configure_4.10.0-5.ubuntu22_amd64.tar.gz
|
||||||
|
dest: "{{ tmp_dir.path }}"
|
||||||
|
remote_src: yes
|
||||||
|
|
||||||
|
- name: Making a list of files
|
||||||
|
shell: "ls {{ tmp_dir.path }}"
|
||||||
|
register: command_result
|
||||||
|
|
||||||
|
- name: Install a .deb package
|
||||||
|
ansible.builtin.apt:
|
||||||
|
deb: "{{ tmp_dir.path }}/{{ item }}"
|
||||||
|
with_items:
|
||||||
|
- "{{ command_result.stdout_lines | reverse }}"
|
||||||
|
|
||||||
|
- name: Remove temp directory
|
||||||
|
become: yes
|
||||||
|
file:
|
||||||
|
path: "{{ tmp_dir.path }}"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Create temp dir
|
||||||
|
file:
|
||||||
|
path: "{{ tmp_dir.path }}"
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: Download old libssl because dell don't know how to package manage or update dependencies
|
||||||
|
get_url:
|
||||||
|
url: http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.18_amd64.deb
|
||||||
|
dest: "{{ tmp_dir.path }}/libssl1.deb"
|
||||||
|
|
||||||
|
- name: unpack deb file
|
||||||
|
shell:
|
||||||
|
cmd: "dpkg -x libssl1.deb {{ tmp_dir.path }}"
|
||||||
|
chdir: "{{ tmp_dir.path }}"
|
||||||
|
|
||||||
|
- name: copy libs
|
||||||
|
copy:
|
||||||
|
src: "{{ tmp_dir.path }}/usr/lib/x86_64-linux-gnu/"
|
||||||
|
dest: "/opt/dell/dcc"
|
||||||
|
remote_src: yes
|
||||||
|
|
||||||
|
- name: Remove temp directory
|
||||||
|
become: yes
|
||||||
|
file:
|
||||||
|
path: "{{ tmp_dir.path }}"
|
||||||
|
state: absent
|
@ -1,13 +1,11 @@
|
|||||||
- name: Check if it's laptop
|
- name: Asus X13 Flow (2022) specific tasks
|
||||||
stat:
|
when:
|
||||||
path: /sys/class/power_supply/BAT0/charge_control_end_threshold
|
- ansible_facts.board_vendor == "ASUSTeK COMPUTER INC."
|
||||||
register: battery_limiter_available
|
- ansible_facts.board_name == "GV301RE"
|
||||||
|
import_tasks: asus-x13-flow.yml
|
||||||
|
|
||||||
- name: Powersave tasks
|
- name: Dell XPS 13 9320 specific tasks
|
||||||
import_tasks: powersave.yml
|
when:
|
||||||
|
- ansible_facts.board_vendor == "Dell Inc."
|
||||||
- when: battery_limiter_available.stat.exists
|
- ansible_facts.board_name == "0CW9KM"
|
||||||
block:
|
import_tasks: dell-xps13.yml
|
||||||
- import_tasks: battery.yml
|
|
||||||
- import_tasks: asusctl.yml
|
|
||||||
- import_tasks: supergfxctl.yml
|
|
Loading…
Reference in New Issue
Block a user