Back to rankings

geerlingguy/ansible-for-devops

Pythonansiblefordevops.com

Ansible for DevOps examples.

ansibledevopsvagrantexamplesjeff-geerlingbookleanpubamazonkindledockerplaybookkubernetes
Star Growth
Stars
9.8k
Forks
3.8k
Weekly Growth
Issues
112
5k
Apr 2014May 2018Jun 2022Jul 2026
ArtifactsPyPIpip install ansible-for-devops
README

Ansible for DevOps Examples

CI Molecule CI

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

Many examples 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.

Manuscript

The book's manuscript is released under the CC BY-SA license, and is publicly available in a separate repository: Ansible for DevOps - Manuscript.

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

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.
  • galaxy-role-servers: A couple very short playbooks that demonstrate how easy it is to get new servers running leveraging the power of community Ansible Galaxy roles.

Chapter 7

  • test-plugin: A simple test plugin that verifies a given value is representative of the color blue.
  • collection: An example local collection to demonstrate the basic structure of content collections.

Chapter 8

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

Chapter 9

  • 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.
  • gluster: A two-server example of building a fast networked storage setup using Gluster.

Chapter 10

  • 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 11

  • security: A playbook containing many security automation tasks to demonstrate how Ansible helps automate security hardening.

Chapter 12

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

Chapter 13

  • molecule: A Molecule example used for testing and developing an Ansible playbook, or for testing in a Continuous Integration (CI) environment.
  • molecule-ci.yml GitHub Actions workflow: A GitHub Actions workflow which runs the molecule example in a CI environment.

Chapter 14

  • 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 15

  • 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.
  • docker-flask: A sample Flask app built with Ansible playbooks running inside the container.

Chapter 16

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

License

MIT

Sponsors

  • TinyPilot: An open-source, low-cost KVM over IP for managing your servers.

The above sponsor(s) are supporting Jeff Geerling on GitHub Sponsors. You can sponsor Jeff's work too, to help him continue improving this book and Ansible open source work!

Buy the Book

Ansible for DevOps Cover

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

Related repositories
bregman-arie/devops-exercises

Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansible, Git, Kubernetes, Terraform, OpenStack, SQL, NoSQL, Azure, GCP, DNS, Elastic, Network, Virtualization. DevOps Interview Questions

PythonPyPIOtherdevopsaws
83.3k19.8k
ansible/ansible

Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy and maintain. Automate everything from code deployment to network configuration to cloud management, in a language that approaches plain English, using SSH, with no agents to install on remote systems. https://docs.ansible.com.

PythonPyPIGNU General Public License v3.0pythonansible
ansible.com
69.6k24.2k
trailofbits/algo

Set up a personal VPN in the cloud

PythonPyPIGNU Affero General Public License v3.0vpn-serverstrongswan
blog.trailofbits.com/2016/12/12/meet-algo-the-vpn-that-works/
30.3k2.4k
MichaelCade/90DaysOfDevOps

This repository started out as a learning in public project for myself and has now become a structured learning map for many in the community. We have 3 years under our belt covering all things DevOps, including Principles, Processes, Tooling and Use Cases surrounding this vast topic.

ShellOtherdevopskubernetes
90daysofdevops.com
29.6k6.7k
StreisandEffect/streisand

Streisand sets up a new server running your choice of WireGuard, OpenConnect, OpenSSH, OpenVPN, Shadowsocks, sslh, Stunnel, or a Tor bridge. It also generates custom instructions for all of these services. At the end of the run you are given an HTML file with instructions that can be shared with friends, family members, and fellow activists.

ShellOthervpnansible
twitter.com/streisandvpn
23.5k2k
kubernetes-sigs/kubespray

Deploy a Production Ready Kubernetes Cluster

JinjaApache License 2.0kubernetes-clusteransible
18.6k6.9k
ansible/awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.

PythonPyPIOtherpythonansible
15.5k3.7k
semaphoreui/semaphore

Modern UI and powerful API for Ansible, Terraform/OpenTofu/Terragrunt, PowerShell and other DevOps tools.

GoGo ModulesMIT Licenseansibledevops
semaphoreui.com
13.9k1.3k
netbootxyz/netboot.xyz

Your favorite operating systems in one place. A network-based bootable operating system installer based on iPXE.

JinjaApache License 2.0ipxenetboot
netboot.xyz
12k831
easzlab/kubeasz

使用Ansible脚本安装K8S集群,介绍组件交互原理,方便直接,不受国内网络环境影响

Jinjakubernetesansible
github.com/easzlab/kubeasz
11.4k3.7k
khuedoan/homelab

Fully automated homelab from empty disk to running services with a single command.

PythonPyPIGNU General Public License v3.0kubernetespxe
homelab.khuedoan.com
9.5k882
Tikam02/DevOps-Guide

DevOps Guide - Development to Production all configurations with basic notes to debug efficiently.

HTMLMIT Licensecheatsheetkubernetes
9.3k2.1k