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

On Mon, Oct 12, 2020 at 9:35 AM Subhash Chandra Ranga <bbb.ra...@gmail.com>
wrote:

>
> ---
> - name: install nginx with the my own php format
>   hosts: webserevers
>   remote_user: ubuntu
>   become: yes
>
>   tasks:
>     - ping: ~
>
>     - name: insert index.php file
>       become: true
>       template: src=/Network-Automation/templates/index.php
> dest="/var/wwww/html/index.php"
>
>     - name: install packages in webservers group
>       yum: name=nginx state = present
>
>     - name: install php7.4_fpm
>       yum: name=php7.4-fpm state = present
>
>     - name: configuring nginx
>       template: src=/templates/nginx.conf dest="/etc/nginx/nginx.conf"
>       notify:
>         -restart php7.4-fpm
>         -restart nginx
>
> - handlers:
>   - name: restart php7.4-fpm
>     service: name=php7.4-fpm state=restarted
>
>   - name: restart nginx
>     service: name=nginx state=restarted
>
>
>
> error
> ERROR! this task 'yum' has extra params, which is only allowed in the
> following modules: win_shell, include_tasks, group_by, win_command,
> import_tasks, script, shell, add_host, include_vars, include_role, raw,
> command, include, import_role, set_fact,
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/c4caa3ed-05da-4d25-8d94-2b4a71d46b81n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/c4caa3ed-05da-4d25-8d94-2b4a71d46b81n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Matt Martz
@sivel
sivel.net

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v9gqx9DDBx0-tJo4SJ-t3HD1Q1fEdsR60sOiv0qp1L1Vg%40mail.gmail.com.

Reply via email to