Are you using ansible tower/awx or in command line? How your inventory file looks like? //vinoth On Mon 12. Oct 2020 at 21:45, Subhash Chandra Ranga <bbb.ra...@gmail.com> wrote:
> --- > - name: install nginx with the my own php format > hosts: webservers > remote_user: ubuntu > become: yes > > tasks: > > - ping: ~ > > - name: install packages in webservers group > become: true > apt: > name: nginx > state: present > > - name: install packages in webservers group > become: true > apt: > name: php7.4-fpm > state: present > > - name: insert index.php file > become: true > template: src=/Network-Automation/templates/index.php > dest="/var/www/html/index.php" > > - name: enabling location in sites-enabled > template: src=/Network-Automation/templates/default > dest="/etc/nginx/sites-enabled/default" > notify: > -restart php7.4-fpm > -restart nginx > > - name: enabling location in sites-available > template: src=/Network-Automation/templates/default > dest="/etc/nginx/sites-available/default" > notify: > -restart php7.4-fpm > -restart nginx > > - name: configuring nginx > template: src=/Network-Automation/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 > when running this im getting :- ERROR! the field 'hosts' is required but > was not set > and also when running nginx its not showing the content that i gave in > index.php file but showing the default one > > -- > 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/c5af062d-a1e7-46ea-bf3f-62332370bc78n%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/c5af062d-a1e7-46ea-bf3f-62332370bc78n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAJ%2BRxtThSqN0YQ_Dmdg5BP_BQ8OXncseC%3D%2BAtVccU59W7wpO7A%40mail.gmail.com.