Skip to content
Ansible examples from Ansible for DevOps.
Python Ruby Lua PHP JavaScript HTML Dockerfile
Branch: master
Clone or download

Latest commit

geerlingguy Merge pull request #231 from fatpixel/master
Fixed typo in lamp-infrastructure/provision.yml
Latest commit 102ccbc Apr 3, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Create FUNDING.yml Dec 11, 2019
deployments-balancer Update deployments-balancer example to use Ubuntu 18.04. Jan 17, 2019
deployments-rolling Fixes #165: Fix lingering deprecation warnings in some examples. Aug 27, 2019
deployments Issue #119: Some additional cleanups for Ruby deployment example. Jan 16, 2019
docker-hubot Fixes #165: Fix lingering deprecation warnings in some examples. Aug 27, 2019
docker Fixes #165: Fix lingering deprecation warnings in some examples. Aug 27, 2019
drupal Fixes #140: Show mapping of examples to book chapters in README. Feb 26, 2020
dynamic-inventory Fixes #140: Show mapping of examples to book chapters in README. Feb 26, 2020
elk Fixes two issues with test failures in CI. Feb 24, 2020
https-letsencrypt Issue #83: Final tweaks to examples in Chapter 12. Aug 20, 2019
https-nginx-proxy Issue #83: Final tweaks to examples in Chapter 12. Aug 20, 2019
https-self-signed Add HTTPS Let's Encrypt example using geerlingguy.certbot role. Sep 16, 2018
includes Fixes #192: Make Drupal playbooks idempotent by fixing permissions is… Jan 16, 2020
jenkins jenkins/README.md: fix typos Sep 24, 2019
kubernetes Update kubectl-connection.yml Sep 12, 2019
lamp-infrastructure Fixed typo in lamp-infrastructure/provision.yml Apr 3, 2020
nodejs-role Issue #169: Various fixes for typos and outdated usage. Sep 4, 2019
nodejs Fix spacing issue in Node.js playbook example. Jan 16, 2020
orchestration Don't verify host keys on multi server orchestration example. Jan 16, 2020
solr Fixes #182: Unused solr.xml template. Dec 2, 2019
tests Fixes two issues with test failures in CI. Feb 24, 2020
.gitignore Remove unneeded pip and docker-compose deps from Kubernetes example. Aug 30, 2018
.travis.yml Issue #196: Move ELK example into this repository. Preliminary tests. Jan 13, 2020
LICENSE Issue #5: Add MIT License. Dec 8, 2014
README.md Fixes #140: Show mapping of examples to book chapters in README. Feb 26, 2020

README.md

Ansible for DevOps Examples

Build Status

This repository contains Ansible examples developed to support different sections of Ansible for DevOps, a book on Ansible by Jeff Geerling.

Most of the examples are full-fledged VM examples, which use Vagrant, VirtualBox, and Ansible to boot and configure VMs on your local workstation. Not all playbooks follow all of Ansible's best practices, as they illustrate particular Ansible features in an instructive manner.

For more interesting examples of what you can do with Ansible, please see the Ansible Vagrant Examples repository, and browse through some of geerlingguy's roles on Ansible Galaxy.

Examples and Chapters in which they're used

Here is an outline of all the examples contained in this repository, by chapter:

Chapter 1

  • N/A

Chapter 2

  • N/A

Chapter 3

  • orchestration: A simple multiple-VM Vagrant configuration and Ansible inventory to allow testing of multi-server orchestration with ansible ad-hoc commands.

Chapter 4

  • drupal: A single-file playbook which configures the LAMP stack on a Linux host and installs Drupal.
  • includes: The same playbook as the drupal example, but using includes to make the playbook more understandable.
  • nodejs: A single-file playbook which configures a Node.js app to run on a Linux host.
  • solr: A single-file playbook which installs Apache Solr on a Linux host.

Chapter 5

  • N/A

Chapter 6

  • nodejs-role: The same playbook as the nodejs example, but using a role to break out the Node.js aspects into a separate nodejs role.

Chapter 7

  • dynamic-inventory: Two example dynamic inventory scripts (one in PHP, one in Python) for use with Ansible.

Chapter 8

  • lamp-infrastructure: A multi-server LAMP-based web application infrastructure focused on high-availability and performance for a LAMP-stack app.
  • elk: A two-server example of the Elasticsearch-Logstash-Kibana stack, which uses one server to store and visualize logs centrally, and another server to send logs via Filebeat.

Chapter 9

  • deployments: A playbook that deploys a Ruby on Rails application into an environment that runs Passenger and Nginx to handle web requests.
  • deployments-balancer: A playbook that handles zero-downtime deployments to webservers running behind an HAProxy load balancer.
  • deployments-rolling: A playbook that demonstrates rolling deployments to multiple servers for a Node.js app.

Chapter 10

  • N/A

Chapter 11

  • jenkins: A playbook that installs and configures Jenkins for CI/CD.

Chapter 12

  • https-self-signed: A playbook that generates self-signed certificates.
  • https-letsencrypt: A playbook that demonstrates automated certificate management with Let's Encrypt and Ansible.
  • https-nginx-proxy: A playbook that demonstrates proxying HTTPS traffic through Nginx to HTTP backends.

Chapter 13

  • docker: Very simple playbook demonstrating Ansible's ability to manage Docker container images.
  • docker-hubot: Slightly more involved example of Ansible's ability to manage and run Docker container images.

Chapter 14

  • kubernetes: A playbook that builds a three-node Kubernetes cluster.

License

MIT

Buy the Book

Ansible for DevOps Cover

Buy Ansible for DevOps for your e-reader or in paperback format.

You can’t perform that action at this time.