- name: Check if authselect current is already using sssd shell: 'authselect current | grep -Pzo "(?s)sssd.*?mkhomedir"' register: grep_result ignore_errors: true - name: Run authselect command: authselect select sssd with-mkhomedir when: grep_result.rc != 0