介绍 (Introduction)
Server automation now plays an essential role in systems administration, due to the disposable nature of modern application environments. Configuration management tools such as Ansible are typically used to streamline the process of automating server setup by establishing standard procedures for new servers while also reducing human error associated with manual setups.
由于现代应用程序环境具有可处理性,因此服务器自动化现在在系统管理中起着至关重要的作用。 配置管理工具(例如Ansible)通常用于通过为新服务器建立标准过程来简化服务器设置自动化的过程,同时还减少了与手动设置相关的人为错误。
Ansible offers a simple architecture that doesn’t require special software to be installed on nodes. It also provides a robust set of features and built-in modules which facilitate writing automation scripts.
Ansible提供了一种简单的体系结构,不需要在节点上安装特殊软件。 它还提供了一组功能强大的功能和内置模块,可帮助编写自动化脚本。
This guide explains how to use Ansible to automate the steps contained in our guide on How To Install Linux, Apache, MySQL and PHP (LAMP) on Ubuntu 18.04. A “LAMP” stack is a group of open-source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is actually an acronym which represents the Linux operating system, with the Apache web server. The site data is stored in a MySQL database, and dynamic content is processed by PHP.
本指南说明了如何使用Ansible来自动化有关如何在Ubuntu 18.04上安装Linux,Apache,MySQL和PHP(LAMP)的指南中包含的步骤。 “ LAMP”堆栈是一组开源软件,通常会一起安装以使服务器能够托管动态网站和Web应用程序。 该术语实际上是首字母缩写词,代表A pache Web服务器的L inux操作系统。 站点数据存储在M ySQL数据库中,动态内容由P HP处理。
先决条件 (Prerequisites)
In order to execute the automated setup provided by the playbook we’re discussing in this guide, you’ll need:
为了执行我们在本指南中讨论的剧本提供的自动设置,您需要:
One Ansible control node: an Ubuntu 18.04 machine with Ansible installed and configured to connect to your Ansible hosts using SSH keys. Make sure the control node has a regular user with sudo permissions and a firewall enabled, as explained in our Initial Server Setup guide. To set up Ansible, please follow our guide on How to Install and Configure Ansible on Ubuntu 18.04.
一个Ansible控制节点 :安装了Ansible并配置为使用SSH密钥连接到您的Ansible主机的Ubuntu 18.04计算机。 确保控制节点具有sudo权限的常规用户并启用了防火墙,如“ 初始服务器设置”指南中所述。 要设置Ansible,请遵循有关如何在Ubuntu 18.04上安装和配置Ansible的指南。
One or more Ansible Hosts: one or more remote Ubuntu 18.04 servers previously set up following the guide on How to Use Ansible to Automate Initial Server Setup on Ubuntu 18.04.
一台或多台Ansible主机 :一台或多台远程Ubuntu 18.04服务器以前是按照有关如何在Ubuntu 18.04上使用Ansible自动化初始服务器设置的指南进行设置的 。
Before proceeding, you first need to make sure your Ansible control node is able to connect and execute commands on your Ansible host(s). For a connection test, please check step 3 of How to Install and Configure Ansible on Ubuntu 18.04.
在继续之前,您首先需要确保Ansible控制节点能够在Ansible主机上连接并执行命令。 对于连接测试,请检查如何在Ubuntu 18.04上安装和配置Ansible的步骤3。