Here are the steps to follow for that :
Be sure to install Ansible on the machine from which you want to automate configuration tasks.
For that you will have to use the commands for the installation according to your operating system
example on debian 11:
Run this command on the terminal sudo apt install ansible and don't forget to update first with this commandn sudo apt update.
Create an inventory file in which you specify the hosts on which you want to perform configuration tasks to include IP addresses and hostnames.
Playbooks are YAML files in which you define tasks to be performed on target hosts.
Roles are an organized way to manage tasks in Ansible. You can group playbooks, variable files, and other related resources into roles.
Use variables to parameterize tasks and make your code more flexible. This makes it easy to tailor configuration tasks for different environments or target hosts.
Once you have configured your playbooks, you can run Ansible to start automating configuration tasks. For this you can use the command
ansible-playbook -i host file.yaml -k.