diff --git a/main.yml b/main.yml index ba8edec..e5fdab9 100755 --- a/main.yml +++ b/main.yml @@ -14,9 +14,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Check for /run/ostree-booted - stat: path=/run/ostree-booted - register: ostree +- name: Check if an ostree OS (e.g. Silverblue) + ansible.builtin.stat: + path: /run/ostree-booted + register: check_ostree +- name: Check for WSL + ansible.builtin.command: + cmd: 'grep microsoft /proc/version' + changed_when: false + ignore_errors: true + register: check_wsl + +- name: Register useful variables + ansible.builtin.set_fact: + ostree: check_ostree.exists + wsl: not check_wsl.failed - include_role: name: arch diff --git a/roles/debian/tasks/main.yml b/roles/debian/tasks/main.yml index e59ba75..09207e7 100644 --- a/roles/debian/tasks/main.yml +++ b/roles/debian/tasks/main.yml @@ -20,10 +20,13 @@ - import_tasks: modules.yml - import_tasks: ssh.yml - import_tasks: solokeys.yml + when: wsl == false - import_tasks: sudo.yml when: gui == true - import_tasks: packagekit.yml when: gui == true - import_tasks: timezone.yml + when: wsl == false - import_tasks: systemd.yml + when: wsl == false - import_tasks: gdm.yml diff --git a/roles/debian/tasks/ssh.yml b/roles/debian/tasks/ssh.yml index bd668c2..6c31d94 100644 --- a/roles/debian/tasks/ssh.yml +++ b/roles/debian/tasks/ssh.yml @@ -26,9 +26,10 @@ name: ssh.service enabled: yes state: started + when: wsl == false - name: Restart SSH become: true ansible.builtin.systemd: name: ssh.service state: restarted - when: changed_ssh_config.changed == true + when: changed_ssh_config.changed == true and wsl == false