Question

Configure Ansible to deploy webserver, and bring it up a port 80 with a web page...

Configure Ansible to deploy webserver, and bring it up a port 80 with a web page that is publically accessible that displays the message: “Hello World”.

Include in the Ansible playbook, plays to deploy and un-deploy the resources

0 0
Add a comment Improve this question Transcribed image text
Answer #1

[root@controller ~]# pwd
/root
[root@controller ~]# mkdir playbooks
[root@controller ~]# cd playbooks
[root@controller playbooks]# pwd
/root/playbooks

In this directory, I’ll then create the following file:

[root@controller playbooks]# cat HelloWorld.yml
---
- name: This is a hello-world example
hosts: ansibleclient01.local
tasks:
- name: Create a file called '/tmp/testfile.txt' with the content 'hello world'.
copy:
content: "hello world\n"
dest: /tmp/testfile.txt

execute this playbook using the “ansible-playbook” command:

[root@controller playbooks]# ansible-playbook HelloWorld.yml

PLAY [This is a hello-world example] *******************************************

TASK [setup] *******************************************************************
ok: [ansibleclient01.local]

TASK [Create a file called '/tmp/testfile.txt' with the content 'hello world'.]
changed: [ansibleclient01.local]

PLAY RECAP *********************************************************************
ansibleclient01.local : ok=2 changed=1 unreachable=0 failed=0

This results in the following file being created on the client:

[root@ansibleclient01 /]# cat /tmp/testfile.txt
hello world

Add a comment
Know the answer?
Add Answer to:
Configure Ansible to deploy webserver, and bring it up a port 80 with a web page...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Project Description In this project, you will be developing a multithreaded Web server and a simple...

    Project Description In this project, you will be developing a multithreaded Web server and a simple web client. The Web server and Web client communicate using a text-based protocol called HTTP (Hypertext Transfer Protocol). Requirements for the Web server The server is able to handle multiple requests concurrently. This means the implementation is multithreaded. In the main thread, the server listens to a specified port, e.g., 8080. Upon receiving an HTTP request, the server sets up a TCP connection to...

  • Figure 1 LAN Subnet: 192.168.40.0124 LAN Switch Internet External Firewall Internal Firewall DMZ Subnet: 192.168.10.0/24 LAN devices Web Server running on port 80 IDS (Snort VM) Remote Access S...

    Figure 1 LAN Subnet: 192.168.40.0124 LAN Switch Internet External Firewall Internal Firewall DMZ Subnet: 192.168.10.0/24 LAN devices Web Server running on port 80 IDS (Snort VM) Remote Access Server (Nginx VM) (OpenVPN) Overview Medium to large organisations typically consist of services that are accessed/consumed from external parties for various purposes. As such, a DMZ is a suitable solution to segregate such services from internal networkis). The network diagram provided (Figure 1) illustrates the IT environment of a medium organisation, which...

  • I need help with my javascript project, I've started on it but I can't seem to...

    I need help with my javascript project, I've started on it but I can't seem to get ym java scripts to work with my index.html. Can someone please help me fix my code? I need the main.js & scratchpad.js to work with my index.html .Thank you Directions: Go to the following link: https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/JavaScript_basics On that page, scroll down to "A 'hello world' example". Follow the step-by-step instructions to download their code and edit it in your text editor of choice....

  • Question - What's next for Google? Is the company right to put so much focus on...

    Question - What's next for Google? Is the company right to put so much focus on Mobile? GOOGLE In 1998, two Stanford University PhD students, Larry Page and Sergey Brin, founded a search engine company and named it Google. The name plays on the number googol-1 followed by 100 zeroes—and refers to the massive quantity of data available online that the company helps users find. Google's corporate mission is "To organize the world's information and make it universally accessible and...

  • Questions 1. With a portfolio as diverse as Google's, what are the company's core brand values?...

    Questions 1. With a portfolio as diverse as Google's, what are the company's core brand values? GOOGLE In 1998, two Stanford University PhD students, Larry Page and Sergey Brin, founded a search engine company and named it Google. The name plays on the number googol-1 followed by 100 zeroes—and refers to the massive quantity of data available online that the company helps users find. Google's corporate mission is "To organize the world's information and make it universally accessible and useful."...

  • Hello I need question 3 with 3/4 of a page. There are two documents as you...

    Hello I need question 3 with 3/4 of a page. There are two documents as you will see. unheuser has strugsled with slow growth of t Market Senacthure Monopoly and Monopoistic Competition 221 ket beers in recent years. U.S. sales laws in its efforts to prevent an Israeli company from successfully selling a generie version of its cholesterol medicine, TriCor. Drug companies usually have three to 10 years of exclusive patent rights remaining when their products hit the market. However,...

  • What are two internal factors for a company in the article below and is the factor...

    What are two internal factors for a company in the article below and is the factor a strength or weakness for the company? Explain. Please include internal factors such as SWOT analysis, core competence, Resources and capability analysis. Based on what you know about the company, which generic company strategy makes sense? Why? What are the pitfalls to avoid for this strategy? SWOT analysis is a strategic planning technique used to help a person or organization identify strengths, weaknesses, opportunities,...

  • Can Technology Save Sears? Sears, Roebuck used to be the largest retailer in the United States, w...

    Can Technology Save Sears? Sears, Roebuck used to be the largest retailer in the United States, with sales representing 1 to 2 percent of the U.S. gross national product for almost 40 years after World War II. Since then, Sears has steadily lost ground to discounters such as Walmart and Target and to competitively priced specialty retailers such as Home Depot and Lowe’s. Even the merger with Kmart in 2005 to create Sears Holding Company failed to stop the downward...

  • Risk management in Information Security today Everyday information security professionals are bombarded with marketing messages around...

    Risk management in Information Security today Everyday information security professionals are bombarded with marketing messages around risk and threat management, fostering an environment in which objectives seem clear: manage risk, manage threat, stop attacks, identify attackers. These objectives aren't wrong, but they are fundamentally misleading.In this session we'll examine the state of the information security industry in order to understand how the current climate fails to address the true needs of the business. We'll use those lessons as a foundation...

  • SYNOPSIS The product manager for coffee development at Kraft Canada must decide whether to introduce the...

    SYNOPSIS The product manager for coffee development at Kraft Canada must decide whether to introduce the company's new line of single-serve coffee pods or to await results from the product's launch in the United States. Key strategic decisions include choosing the target market to focus on and determining the value proposition to emphasize. Important questions are also raised in regard to how the new product should be branded, the flavors to offer, whether Kraft should use traditional distribution channels or...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT