ansible aws_使用Ansible将AWS云配置和应用部署到AWS

ansible aws

This blog describes how create an EC2 instance and deploy a web application on AWS. In this blog we will walk through the introduction and benefits of using Ansible over other configuration management tools. Apart from this, we will show how to setup Ansible, define roles and write playbook to provision an ec2 instance and deploy a simple web application using Ansible.

博客 描述了如何创建EC2实例以及如何 AWS 部署 Web应用程序 在此博客中,我们将介绍与其他配置管理工具相比使用Ansible的介绍和好处。 除此之外,我们还将展示如何设置Ansible,定义角色和编写剧本以供应ec2实例以及使用Ansible部署简单的Web应用程序。

什么是Ansible? (What is Ansible?)

Ansible is an open-source platform used for automation and for various operations such as cloud provisioning, configuration management, application deployment, intra-service orchestration, continuous delivery, orchestration, and many other IT needs.

一个 nsible是用于自动化和进行各种操作,如开源平台云供应配置管理应用程序部署内部服务流程 ,不断交付,业务流程,以及许多其他的IT需求。

Designed for multi-tier deployments since day one, Ansible models your IT infrastructure by describing how all of your systems inter-relate, rather than just managing one system at a time. Ansible is easy to set up, and it is efficient, reliable, and powerful.

从一开始就专为多层部署而设计,Ansible通过描述所有系统之间的相互关系而不是一次仅管理一个系统来为您的IT基础架构建模。 Ansible易于设置,并且高效,可靠且功能强大。

It uses no agents and no additional custom security infrastructure, so it’s easy to deploy — and most importantly, it uses a very simple language (YAML, in the form of Ansible Playbooks) that allow you to describe your automation jobs in a way that approaches plain English.

它不使用任何代理程序,也不使用其他自定义安全性基础结构,因此易于部署-最重要的是,它使用一种非常简单的语言( YAML ,以Ansible Playbooks的形式),使您可以通过以下方式描述自动化工作普通英语。

Ansible中的重要术语 (Important Terms in Ansible)

These are the few important terms using in Ansible —

这些是Ansible中使用的几个重要术语-

  • Controller Node: This is where Ansible gets installed. The controller machine helps in enabling provisioning on servers we manage.

    控制器节点:这是Ansible的安装位置。 控制器机器有助于在我们管理的服务器上启用配置。

  • Managed Node: This is nodes where the task is executed by the controller node.

    受管节点:这是由控制器节点执行任务的节点。

  • Inventory: This is basically an initializing file that contains information about the servers that we are managing.

    库存:这基本上是一个初始化文件,其中包含有关我们正在管理的服务器的信息。

  • Modules: These are little programs that act as building blocks encapsulating common tasks such as using yum to install packages or ping to test the connection to a remote host.

    模块:这些小程序充当构建通用任务的构建块,例如使用yum安装软件包或ping命令测试与远程主机的连接。

  • Playbook: It is an organized unit of scripts defining an automated work for the configuration management of our server.

    剧本:这是脚本的有组织单位,用于定义服务器配置管理的自动化工作。

  • Task: A task block defines a single procedure to be executed on the server like installing packages.

    任务:任务块定义了要在服务器上执行的单个过程,例如安装软件包。

Ansible工作流程 (Ansible Workflow)

  1. As the services increase, sysadmins will provision more servers to do configuration management. They need to install Ansible on the master node where they need to write the code into the Ansible playbook to describe the setup, installation process, and the configuration required for these servers.

    随着服务的增加,系统管理员将提供更多服务器来进行配置管理。 他们需要在主节点上安装Ansible,在主节点上需要将代码写入Ansible剧本中,以描述这些服务器所需的设置,安装过程和配置。
  2. The local machine connects to these servers (nodes) through an inventory using secured SSH connections.

    本地计算机使用安全的SSH连接通过清单连接到这些服务器(节点)。
  3. Once these nodes are connected to the master server, then the node servers are analyzed and the playbook codes are pushed toward each of the servers so that these playbooks can configure the servers remotely, which leads to a consistent environment.

    这些节点连接到主服务器后,便会分析节点服务器,并将剧本代码推向每个服务器,以便这些剧本可以远程配置服务器,从而实现一致的环境。

使用Ansible的好处 (Benefits of Using Ansible)

  • Agentless: As long as a connection can be SSHed and it has Python, i

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值