Ansible: Up and Running by Lorin Hochstein

By Lorin Hochstein

Among the configuration administration instruments on hand, Ansible has a few designated advantages—it’s minimum in nature, you don’t have to set up something in your nodes, and it has a simple studying curve. This useful advisor indicates you the way to be efficient with this device speedy, no matter if you’re a developer deploying code to construction or a method administrator trying to find a greater automation solution.

Author Lorin Hochstein exhibits you ways to write down playbooks (Ansible’s configuration administration scripts), deal with distant servers, and discover the tool’s actual strength: integrated declarative modules.

You’ll become aware of that Ansible has the performance you wish and the simplicity you desire.

• know how Ansible differs from different configuration administration systems
• Use the YAML dossier layout to write down your personal playbooks
• study Ansible’s aid for variables and facts
• paintings with an entire instance to installation a non-trivial applicationUse roles to simplify and reuse playbooks
• Make playbooks run speedier with ssh multiplexing, pipelining, and parallelism
• install functions to Amazon EC2 and different cloud platforms
• Use Ansible to create Docker photographs and installation Docker packing containers

Show description

Read Online or Download Ansible: Up and Running PDF

Best software books

Fundamental Approaches to Software Engineering: 12th International Conference, FASE 2009, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2009, York, UK, March 22-29, 2009. Proceedings

This booklet constitutes the refereed complaints of the twelfth overseas convention on basic methods to software program Engineering, FASE 2009, held in York, united kingdom, in March 2009, as a part of ETAPS 2009, the ecu Joint meetings on idea and perform of software program. The 30 revised complete papers provided including 2 software demonstrations have been rigorously reviewed and chosen from 123 regluar and nine software paper submissions.

Software Business: 6th International Conference, ICSOB 2015, Braga, Portugal, June 10-12, 2015, Proceedings

This e-book includes the refereed lawsuits of the sixth foreign convention on software program company, ICSOB 2015, held in Braga, Portugal, in June 2015. The subject of the development used to be "Enterprising towns" concentrating on a seen spillover of software program inside of different industries allowing new enterprise types: businesses package deal their actual items and software program providers into options and begin to promote autonomous software program items as well as actual items.

Software Architecture: 10th European Conference, ECSA 2016, Copenhagen, Denmark, November 28 -- December 2, 2016, Proceedings

This ebook constitutes the complaints of the tenth eu convention on software program structure, ECSA 2016, held in Copenhagen, Denmark, in November/December 2016. The thirteen complete papers offered including 12 brief papers have been conscientiously reviewed and chosen from eighty four submissions. they're geared up in topical sections on complete study and adventure papers, brief papers for addressing rising examine, and schooling and coaching papers.

Extra info for Ansible: Up and Running

Example text

I fix the error in my playbook. 5. I run Ansible again. 6 Alternatively, we could reload the configuration file using state=reloaded instead of restarting the service. 42 | Chapter 2: Playbooks: A Beginning 6. None of the tasks report a state change the second time around, so Ansible doesn’t run the handler. Running the Playbook As before, we use the ansible-playbook command to run the playbook. yml The output should look something like this: PLAY [Configure webserver with nginx and tls] ********************************* GATHERING FACTS *************************************************************** ok: [testserver] TASK: [Install nginx] ********************************************************* changed: [testserver] TASK: [create directories for tls certificates] ******************************* changed: [testserver] TASK: [copy TLS key] ********************************************************** changed: [testserver] TASK: [copy TLS certificate] ************************************************** changed: [testserver] TASK: [copy nginx config file] ************************************************ changed: [testserver] TASK: [enable configuration] ************************************************** ok: [testserver] NOTIFIED: [restart nginx] ***************************************************** changed: [testserver] PLAY RECAP ******************************************************************** testserver : ok=8 changed=6 unreachable=0 failed=0 Point your browser to https://localhost:8443 (don’t forget the “s” on https).

Cfg in the current directory, alongside my playbooks. That way, I can check it into the same version control repository my playbooks are in. cfg file that specifies the location of the inventory file (hostfile), the user to SSH (remote_user), and the SSH private key (private_key_file). This assumes you’re using Vagrant. If you’re using your own server, you’ll need to set the remote_user and private_key_file values accordingly. Our example configuration also disables SSH host key checking. ssh/ known_hosts file every time we destroy and recreate a Vagrant machine.

The handlers we discussed here are just one form of control flow that Ansible supports. In a later chapter, we’ll see iteration and conditionally running tasks based on the values of variables. In the next chapter, we’ll talk about the “who”; in other words, how to describe the hosts that your playbooks will run against. 44 | Chapter 2: Playbooks: A Beginning CHAPTER 3 Inventory: Describing Your Servers So far, we’ve been working with only one server (or host, as Ansible calls it). In reality, you’re going to be managing multiple hosts.

Download PDF sample

Rated 4.22 of 5 – based on 37 votes

Related posts