Playbook to install and start nginx on ubuntu

0 votes
I'm very new to ansible and I would like to know how to write a playbook to install and start nginx on ubuntu. Thank you
Mar 15 in Ansible by Kabeer
31 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Write your playbook like this:

---
- hosts: droplets
  tasks:
    - name: Installs nginx web server
      apt: pkg=nginx state=installed update_cache=true
      notify:
        - start nginx

  handlers:
    - name: start nginx
      service: name=nginx state=started
answered Mar 15 by Deep

Related Questions In Ansible

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How do I install Ansible on Ubuntu?

Hey Kiara, Execute the following commands to Install ...READ MORE

answered Feb 20 in Ansible by Kunal
18 views
0 votes
1 answer

Playbook to get my current IP - Ansible and AWS

Hey Komal, that's pretty simple. Try this: - ...READ MORE

answered Mar 24 in Ansible by Aarohi
22 views
0 votes
1 answer
0 votes
1 answer
0 votes
2 answers
0 votes
1 answer

Unable to install Ansible on centOS

Seems like you're stuck at creating ansible ...READ MORE

answered Dec 19, 2018 in Ansible by Alan
17 views
0 votes
1 answer

Install mean stack on ubuntu using ansible

You can have three roles  under /etc/ansible/roles -prerequisites -mongodb -nodejs under /etc/ansible ...READ MORE

answered Mar 15 in Ansible by Janice
27 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.