--- - name: Check if config_owner_user existed getent: database: passwd key: "{{ config_owner_user }}" - name: Check if config_owner_group existed getent: database: group key: "{{ config_owner_group }}" register: getent_group # NOTE(duonghq): it's only a basic check, should be refined later - name: Check if ansible user can do passwordless sudo command: "true" become: yes register: result failed_when: result is failed changed_when: False check_mode: false