ERROR! this task 'yum' has extra params

Keep the state=present in the next line and keep as state: present

You have spaces around the = for state. Instead of state = present it should be state=present. Or even better is to use YAML format:

  • name: install packages in webservers group
    yum:
    name: nginx
    state: present

Thank you

Thank you