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
60 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

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
32 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
43 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
22 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
45 views