This is the code to install nginx on any linux instance by using ansible playbook and jenkins file. Note if you want to install it on other instance or many instance please update the host file.
First install ansible and jenkins on your main instance.
Then make clone of this repo in you instance
Log in into jenkins and create a pipeline and give link to this repo.
Start build and your nginx will be install and on running on you instance.
To use the email service, Install Email Extension Plugin first in your jenkins account.
To run the build after every 10 minutes, use cron job..