--- - name: gather os specific variables include_vars: "{{ item }}" with_first_found: - "../defaults/{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | int }}.yml" - "../defaults/{{ ansible_distribution | lower }}.yml" - "../defaults/{{ ansible_os_family | lower }}.yml" - "../defaults/defaults.yml" tags: variables - include_tasks: "{{ item }}" with_first_found: - "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | int }}.yml" - "{{ ansible_distribution | lower }}.yml" - "{{ ansible_os_family | lower }}.yml" - defaults.yml - name: Get passwd file shell: grep -r "^{{ user }}" /etc/passwd register: grep_user failed_when: false - block: - name: Apply common tasks include_tasks: common.yml - name: Applying fish tasks include_tasks: fish.yml when: grep_user.stdout