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
167 views

1 answer to this question.

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

+1 vote
1 answer

Ansible-playbook to install and configure Nginx+Nodejs+Npm+PM2

Try thhis out: --- - hosts: hosts tasks: ...READ MORE

answered Sep 3 in Ansible by Kalgi
• 40,420 points
37 views
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
49 views
0 votes
1 answer
0 votes
2 answers
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
28 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
65 views