I have installed and configured Ansible on the server for config management purpose.
under /etc/ansible/hosts file, I have added [servers] part and mentioned all servers which I need to maintain
I have one Ubuntu server in that
In my test.yml file I have written this code,
---
- hosts: servers
become: yes
tasks:
- name: Add user
user:
name: james
shell: /bin/bash
groups: wheel
state: present
remove: yes
Problem is that in Ubuntu there is no wheel group present but sudo is.
so I want that server to add a user in sudo group and for others to add to the wheel group
how I can do condition in ansible in that code