From 4e957fa9599454f5b80b4077b03ed7b6bf128beb Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Thu, 23 Mar 2023 16:33:47 -0400 Subject: [PATCH] Move the power role into the CPU role. --- .../environments/laptop/host_vars/odolinux | 1 + ansible/playbook.yaml | 1 - .../files/disable_turboboost_tmpfiles.conf | 0 ansible/roles/cpu/tasks/linux.yaml | 8 ++--- .../linux.yaml => cpu/tasks/linux_intel.yaml} | 0 .../energy_performance_preference.conf.j2 | 0 ansible/roles/power/tasks/common.yaml | 15 ---------- ansible/roles/power/tasks/freebsd.yaml | 5 ---- ansible/roles/power/tasks/main.yaml | 2 -- ansible/roles/power/tasks/peruser.yaml | 29 ------------------- .../roles/power/tasks/peruser_freebsd.yaml | 0 ansible/roles/power/tasks/peruser_linux.yaml | 0 12 files changed, 3 insertions(+), 58 deletions(-) rename ansible/roles/{power => cpu}/files/disable_turboboost_tmpfiles.conf (100%) rename ansible/roles/{power/tasks/linux.yaml => cpu/tasks/linux_intel.yaml} (100%) rename ansible/roles/{power => cpu}/templates/energy_performance_preference.conf.j2 (100%) delete mode 100644 ansible/roles/power/tasks/common.yaml delete mode 100644 ansible/roles/power/tasks/freebsd.yaml delete mode 100644 ansible/roles/power/tasks/main.yaml delete mode 100644 ansible/roles/power/tasks/peruser.yaml delete mode 100644 ansible/roles/power/tasks/peruser_freebsd.yaml delete mode 100644 ansible/roles/power/tasks/peruser_linux.yaml diff --git a/ansible/environments/laptop/host_vars/odolinux b/ansible/environments/laptop/host_vars/odolinux index 90062eb..ed6cf1c 100644 --- a/ansible/environments/laptop/host_vars/odolinux +++ b/ansible/environments/laptop/host_vars/odolinux @@ -26,5 +26,6 @@ build_user: wireguard_directory: odo enabled_wireguard: - wgh +cputype: "intel" hwpstate: true cores: 8 diff --git a/ansible/playbook.yaml b/ansible/playbook.yaml index e5a96c7..aa170d8 100644 --- a/ansible/playbook.yaml +++ b/ansible/playbook.yaml @@ -41,7 +41,6 @@ - wireguard - portshaker - poudriere - - power - android - latex - pyenv diff --git a/ansible/roles/power/files/disable_turboboost_tmpfiles.conf b/ansible/roles/cpu/files/disable_turboboost_tmpfiles.conf similarity index 100% rename from ansible/roles/power/files/disable_turboboost_tmpfiles.conf rename to ansible/roles/cpu/files/disable_turboboost_tmpfiles.conf diff --git a/ansible/roles/cpu/tasks/linux.yaml b/ansible/roles/cpu/tasks/linux.yaml index e1835f0..69f3268 100644 --- a/ansible/roles/cpu/tasks/linux.yaml +++ b/ansible/roles/cpu/tasks/linux.yaml @@ -1,6 +1,2 @@ -# - name: Install packages -# pacman: -# name: -# - foo -# state: present -# update_cache: true +- include_tasks: "tasks/linux_{{cputype}}.yaml" + when: cputype is defined diff --git a/ansible/roles/power/tasks/linux.yaml b/ansible/roles/cpu/tasks/linux_intel.yaml similarity index 100% rename from ansible/roles/power/tasks/linux.yaml rename to ansible/roles/cpu/tasks/linux_intel.yaml diff --git a/ansible/roles/power/templates/energy_performance_preference.conf.j2 b/ansible/roles/cpu/templates/energy_performance_preference.conf.j2 similarity index 100% rename from ansible/roles/power/templates/energy_performance_preference.conf.j2 rename to ansible/roles/cpu/templates/energy_performance_preference.conf.j2 diff --git a/ansible/roles/power/tasks/common.yaml b/ansible/roles/power/tasks/common.yaml deleted file mode 100644 index fef1101..0000000 --- a/ansible/roles/power/tasks/common.yaml +++ /dev/null @@ -1,15 +0,0 @@ -- import_tasks: tasks/freebsd.yaml - when: 'os_flavor == "freebsd"' - -- import_tasks: tasks/linux.yaml - when: 'os_flavor == "linux"' - -- include_tasks: - file: tasks/peruser.yaml - apply: - become: yes - become_user: "{{ initialize_user }}" - when: users is defined - loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}" - loop_control: - loop_var: initialize_user diff --git a/ansible/roles/power/tasks/freebsd.yaml b/ansible/roles/power/tasks/freebsd.yaml deleted file mode 100644 index b417174..0000000 --- a/ansible/roles/power/tasks/freebsd.yaml +++ /dev/null @@ -1,5 +0,0 @@ -# - name: Install packages -# package: -# name: -# - foo -# state: present diff --git a/ansible/roles/power/tasks/main.yaml b/ansible/roles/power/tasks/main.yaml deleted file mode 100644 index 6805b9d..0000000 --- a/ansible/roles/power/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -- import_tasks: tasks/common.yaml - # when: foo is defined diff --git a/ansible/roles/power/tasks/peruser.yaml b/ansible/roles/power/tasks/peruser.yaml deleted file mode 100644 index 111e886..0000000 --- a/ansible/roles/power/tasks/peruser.yaml +++ /dev/null @@ -1,29 +0,0 @@ -- include_role: - name: per_user - -# - name: Create directories -# file: -# name: "{{ account_homedir.stdout }}/{{ item }}" -# state: directory -# mode: 0700 -# owner: "{{ account_name.stdout }}" -# group: "{{ group_name.stdout }}" -# loop: -# - ".config/foo" - -# - name: Copy files -# copy: -# src: "files/{{ item.src }}" -# dest: "{{ account_homedir.stdout }}/{{ item.dest }}" -# mode: 0600 -# owner: "{{ account_name.stdout }}" -# group: "{{ group_name.stdout }}" -# loop: -# - src: foo.conf -# dest: .config/foo/foo.conf - -- import_tasks: tasks/peruser_freebsd.yaml - when: 'os_flavor == "freebsd"' - -- import_tasks: tasks/peruser_linux.yaml - when: 'os_flavor == "linux"' diff --git a/ansible/roles/power/tasks/peruser_freebsd.yaml b/ansible/roles/power/tasks/peruser_freebsd.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/ansible/roles/power/tasks/peruser_linux.yaml b/ansible/roles/power/tasks/peruser_linux.yaml deleted file mode 100644 index e69de29..0000000