---
- name: Enable sudo access for wheel group
  lineinfile:
    dest: /etc/sudoers
    state: present
    regexp: '^%wheel'
    line: '%wheel ALL=(ALL) NOPASSWD: ALL'
    validate: 'visudo -cf %s'
  tags:
    - sudo

---
- name: Enable sudo access for wheel group
  become: yes
  copy:
    content: '%wheel ALL=(ALL) ALL'
    dest: /etc/sudoers.d/10-grant-wheel-group
    validate: 'visudo -cf %s'
  tags:
    - sudo

Use sudoers.d instead of modifiying file
Use sudoers.d instead of modifiying file
