How to configure the Nginx server in AWS with Ansible Playbook

0 votes

Hi Guys,

I am new to Ansible Playbook. I want to configure the Nginx server in AWS with the Ansible Playbook. How can I do that?

Oct 12, 2020 in Ansible by akhtar
• 38,230 points
2,791 views

1 answer to this question.

0 votes

Hi@akhtar,

To configure the Nginx server in AWS, you need to install the software for Nginx. After that, you can host any page in the Nginx server as shown below.

- hosts: ec2_instance_ips
  remote_user: ubuntu
  become: True
  tasks:
    - name: Install nginx
      apt:
        name: nginx
        state: present
    - name: Create default index page
      copy:
        dest: /usr/share/nginx/html/index.html
        content: "Howdy from {{ ansible_hostname }}"
    - name: Restart nginx
      service:
        name: nginx
        state: restarted
answered Oct 12, 2020 by MD
• 95,440 points

Related Questions In Ansible

0 votes
1 answer

How do I wget a file from web server using shell in the ansible playbook

Hey Ayaan, you could probably use this ...READ MORE

answered Jan 24, 2019 in Ansible by Anushri
3,862 views
0 votes
1 answer

How to overwrite the content of a file in remote systems using Ansible playbook?

Hi@akhtar, You can find one argument in the ...READ MORE

answered Aug 2, 2020 in Ansible by MD
• 95,440 points
13,263 views
0 votes
1 answer

How to capture the output of a task in Ansible Playbook?

Hi@akhtar, Ansible registers module used to capture/store the ...READ MORE

answered Aug 2, 2020 in Ansible by MD
• 95,440 points
14,371 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,503 views
+2 votes
1 answer
0 votes
1 answer

How to create an Elastic Load Balancer in AWS with Ansible Playbook?

Hi@akhtar, You can find one module in ansible ...READ MORE

answered Oct 12, 2020 in Ansible by MD
• 95,440 points
919 views
0 votes
1 answer

How to configure httpd web server using Ansible Playbook?

Hi@akhtar, You need to write one program file ...READ MORE

answered Jul 30, 2020 in Ansible by MD
• 95,440 points
2,984 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP