当前位置: 首页 > 软件库 > 云计算 > 云原生 >

ansible-for-devops

Ansible for DevOps examples.
授权协议 MIT License
开发语言 Google Go
所属分类 云计算、 云原生
软件类型 开源软件
地区 不详
投 递 者 温凯
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

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.

  •  yum -y install ansible  ansible --version    mkdir /etc/ansible  touch /etc/ansible/hosts   [example]     www.example.com ansible example -m ping -u [username] ansible example -a "free -m" -u [userna

  • 创建角色、ansible-galaxy的简单使用 1.1 创建角色 角色创建流程 在Ansible中创建角色不需要特别的开发工具。创建和使用角色包含三个步骤: 创建角色目录结构 定义角色内容 在playbook中使用角色 1.1 创建角色目录结构 默认情况下,Ansible在Ansible Playbook所在目录的roles子目录中查找角色。这样,用户可以利用playbook和其他支持文件存储角

  • 创建角色、ansible-galaxy简单使用 1.创建角色 角色创建流程 在Ansible中创建角色不需要特别的开发工具。创建和使用角色包含三个步骤: 创建角色目录结构 定义角色内容 在playbook中使用角色 2.创建角色的两种方式 用mkdir直接创建 [root@centos8-1 roles]# mkdir -p nginx/{defaults,vars,files,templates

  • 目录 一.  前言 二.  include介绍 2.1  include导入tasks 2.2   include时导入变量 2.3  inclued使用tag 2.4  include中使用循环 2.5  include使用条件判断 2.6  include 导入handlers 2.7  include 导入playbook 三.  include_tasks介绍 3.1  include_t

  • 1.user:创建用户、删除用户、更改密码 #cat create_user.yaml --- - name: create user for machine hosts: devops tasks: - name: create user for machine user: name: natasha comment: system-

  • 创建角色 角色创建流程 在Ansible中创建角色不需要特别的开发工具。创建和使用角色包含三个步骤: 创建角色目录结构 定义角色内容 在playbook中使用角色 1.创建角色目录结构 默认情况下,Ansible在Ansible Playbook所在目录的roles子目录中查找角色。这样,用户可以利用playbook和其他支持文件存储角色。 如果Ansible无法在该位置找到角色,它会按照顺序在A

  • 写在前面 今天和小伙伴们分享一些 Ansible中 Playbook 执行速度优化的笔记 博文通过7种不同的优化方式,合理利用可配置项,从而提高 Playbook 的执行速度 个人感觉如果受控机数量很少,其实没必要速度调优 所谓的执行速度调优大多是牺牲一定的功能,或则增加对资源的占用 如果搭建Pass环境或者大型的分布式系统集群运维,涉及机器多,优化还是很有必要的 食用方式 了解Ansible基础

  • Ansible-8-vault 加密功能 //加密 [student@workstation data-variables]$ ansible-vault create test.yml New Vault password: Confirm New Vault password: //查看文件,是乱码 [student@workstation data-variables]$ cat te

  • 一、创建角色 角色创建流程 在Ansible中创建角色不需要特别的开发工具。创建和使用角色包含三个步骤: 创建角色目录结构 定义角色内容 在playbook中使用角色 1.创建角色目录结构 默认情况下,Ansible在Ansible Playbook所在目录的roles子目录中查找角色。这样,用户可以利用playbook和其他支持文件存储角色。 如果Ansible无法在该位置找到角色,它会按照顺序

 相关资料
  • 我有一些Ansible剧本,我想和一些Windows主机对抗。我遵循了各种Ansible指南来设置WinRM,它们工作得很好,但默认设置非常不安全,我想要更适合生产的东西。然而,关于如何做到这一点的说明却少得令人难以置信。到目前为止,我已经做了以下工作: 在我的Windows盒子上: 使用提供的配置RemotingForAnsible.ps1脚本启用WinRM 将目标机器配置为在HTTPS/598

  • 在我們成功利用 Vagrant 模擬出所需的環境後,接下來就可以開始使用 Ansible 這套自動化工具來進行部署了。

  • Ansible Engine 什么是 Ansible Ansible 是一款开源自动化平台,它是一款简单自动化语言,能够在 Ansible Playbook 中完美地描述 IT 基础架构。它同时提供了一个自动化引擎用来执行 Asible Playbook。 Ansible 具有多个重要的优点: 跨平台支持 - Ansible 提供 Linux、Windows、UNIX 和网络设备的无代理支持,适用

  • Ansible 提供一种最简单的方式用于发布、管理和编排计算机系统的工具,你可在数分钟内搞定。 Ansible 是一个模型驱动的配置管理器,支持多节点发布、远程任务执行。默认使用 SSH 进行远程连接。无需在被管理节点上安装附加软件,可使用各种编程语言进行扩展。

  • 认识ansible tower 我们先来点点鼠标看看tower中都有什么,不过在点鼠标之前心中应该有数,所有的功能都不会脱离三大类 用户权限管理 执行ansible playbook(ansible管理员节点)需要配置的 统计信息 当然,ansible管理节点需要配置的东西较多,也是tower的主体功能,所以涉及的页面也会多一样。 回顾下安装后的第一个页面(如下图)。 主要版面 页面的主要版面是D

  • Ansible Tower是一个中心化的管理节点网站,需要解决企业级的 用户的两个难题,一个是直接在每个管理员自己的电脑上放置ssh有安全的隐患,另外一个是如果有新管理员加入,面对海量的机群配置ssh连接有工作量巨大,效率低下。 作为一个ansilbe管理节点网站,那么它自然应该具备两个方面的功能: 像其它管理网站一样,具有用户的创建和权限管理的功能; 像ansible管理节点一样,配置远程主机的