Ansible for DevOps examples.

Overview

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.

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

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.

Owner
Jeff Geerling
Father, author, developer, maker. Sometimes called "an inflammatory enigma". #stl #drupal #ansible #k8s #raspberrypi #crohns
Jeff Geerling
Visual disk-usage analyser for docker images

whaler What? A command-line tool for visually investigating the disk usage of docker images Why? Large images are slow to move and expensive to store.

Treebeard Technologies 194 Sep 01, 2022
Chartreuse: Automated Alembic migrations within kubernetes

Chartreuse: Automated Alembic SQL schema migrations within kubernetes "How to automate management of Alembic database schema migration at scale using

Wiremind 8 Oct 25, 2022
A simple python application for running a CI pipeline locally This app currently supports GitLab CI scripts

🏃 Simple Local CI Runner 🏃 A simple python application for running a CI pipeline locally This app currently supports GitLab CI scripts ⚙️ Setup Inst

Tom Stowe 0 Jan 11, 2022
Let's Git - Version Control & Open Source Homework

Let's Git - Version Control & Open Source Homework Welcome to this homework for our MOOC: Let's Git! We hope you will learn a lot and have fun working

1 Dec 05, 2021
A colony of interacting processes

NColony Infrastructure for running "colonies" of processes. Hacking $ tox Should DTRT -- if it passes, it means unit tests are passing, and 100% cover

23 Apr 04, 2022
This project shows how to serve an TF based image classification model as a web service with TFServing, Docker, and Kubernetes(GKE).

Deploying ML models with CPU based TFServing, Docker, and Kubernetes By: Chansung Park and Sayak Paul This project shows how to serve a TensorFlow ima

Chansung Park 104 Dec 28, 2022
Knock your images before these make you painful.

image-knocker Knock your images before these make you painful. Background One day, I had run my deep learning model training program and got off work

Yonghye Kwon 9 Jul 25, 2022
Docker Container wallstreetbets-sentiment-analysis

Docker Container wallstreetbets-sentiment-analysis A docker container using restful endpoints exposed on port 5000 "/analyze" to gather sentiment anal

145 Nov 22, 2022
A Python library for the Docker Engine API

Docker SDK for Python A Python library for the Docker Engine API. It lets you do anything the docker command does, but from within Python apps – run c

Docker 6.1k Dec 31, 2022
Spinnaker is an open source, multi-cloud continuous delivery platform for releasing software changes with high velocity and confidence.

Welcome to the Spinnaker Project Spinnaker is an open-source continuous delivery platform for releasing software changes with high velocity and confid

8.8k Jan 07, 2023
Daemon to ban hosts that cause multiple authentication errors

__ _ _ ___ _ / _|__ _(_) |_ ) |__ __ _ _ _ | _/ _` | | |/ /| '_ \/ _` | ' \

Fail2Ban 7.8k Jan 09, 2023
Flexible and scalable monitoring framework

Presentation of the Shinken project Welcome to the Shinken project. Shinken is a modern, Nagios compatible monitoring framework, written in Python. It

Gabès Jean 1.1k Dec 18, 2022
Coding For Entrepreneurs 100 Jan 01, 2023
Inferoxy is a service for quick deploying and using dockerized Computer Vision models.

Inferoxy is a service for quick deploying and using dockerized Computer Vision models. It's a core of EORA's Computer Vision platform Vision Hub that runs on top of AWS EKS.

94 Oct 10, 2022
Dockerized service to backup all running database containers

Docker Database Backup Dockerized service to automatically backup all of your database containers. Docker Image Tags: docker.io/jandi/database-backup

Jan Dittrich 16 Dec 31, 2022
Tencent Yun tools with python

Tencent_Yun_tools 使用 python3.9 + 腾讯云 AccessKey 利用工具 使用之前请先填写config.ini配置文件 Usage python3 Tencent_rce.py -h Scanner python3 Tencent_rce.py -s 生成CSV

<img src="> 13 Dec 20, 2022
Self-hosted, easily-deployable monitoring and alerts service - like a lightweight PagerDuty

Cabot Maintainers wanted Cabot is stable and used by hundreds of companies and individuals in production, but it is not actively maintained. We would

Arachnys 5.4k Dec 23, 2022
This is a tool to develop, build and test PHP extensions in Docker containers.

Develop, Build and Test PHP Extensions This is a tool to develop, build and test PHP extensions in Docker containers. Installation Clone this reposito

Suora GmbH 10 Oct 22, 2022
Checkmk kube agent - Checkmk Kubernetes Cluster and Node Collectors

Checkmk Kubernetes Cluster and Node Collectors Checkmk cluster and node collecto

tribe29 GmbH 15 Dec 26, 2022