diff --git a/tasks/ac-power.yaml b/tasks/ac-power.yaml new file mode 100644 index 0000000..3ef125e --- /dev/null +++ b/tasks/ac-power.yaml @@ -0,0 +1,10 @@ +--- + +- name: ensure acpi tool is installed + apt: + pkg: acpi +- name: ensure host is on AC power + command: acpi -a + register: _acpi_ac_adapter + failed_when: '"off-line" in _acpi_ac_adapter.stdout' + changed_when: false diff --git a/tasks/main.yaml b/tasks/main.yaml index 37e3b5c..37864b5 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -1,5 +1,7 @@ --- +- import_tasks: ac-power.yaml + - import_role: name: display_manager vars: