--- - hosts: centos8 become: true vars: sudoers: ansible tasks: - name: All users from groub 'wheel' are allowed sudo users copy: content: "# Allows people in group wheel to run all command\n%wheel ALL=(ALL) ALL\n" dest: /etc/sudoers.d/10_passwd_sudo_wheel owner: root group: root mode: "0440" validate: visudo -cf %s ...