mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-25 23:11:02 +08:00
stevenzdg988 translating
This commit is contained in:
parent
df03381966
commit
b64ee14802
@ -39,12 +39,17 @@ In fact, the above example is not correct: **grep** doesn't look for the **ap
|
||||
|
||||
Clearly, management tools that make it hard to perform simple tasks from scripts are, at best, a difficult basis for larger management systems. Recognizing this, existing configuration-management systems, such as Puppet, Chef, or Ansible, have gone to great lengths to build their own internal APIs around the management of basic operating system resources. These resource abstractions are internal APIs, and closely tied to the needs of their respective tools. This causes not only a colossal duplication of effort, but also creates a strong barrier to entry for new and innovative management tools.
|
||||
|
||||
|
||||
很显然,管理工具很难从脚本执行简单的任务,在最好的情况下,对于一个较大的基础管理系统是困难的。认识到这一点,退出配置管理系统,比如 Puppet,Chef,及 Ansible,围绕基本操作系统资源管理竭尽全力的建立其内部的 API 就是明智的。这些资源由各自需要的密切相关的工具抽象成内部的 API。这不仅导致大量的重复性工作,也为尝试一个新的和创新管理工具设置了强大的障碍。
|
||||
|
||||
One area where this barrier to entry becomes evident is in building VM or container images: In the course of building such images, it is often necessary to either answer simple questions about them or make simple changes to them. But since the tools for this all require special treatment, these questions and changes face exactly the problems that somebody trying to script them faces. As a consequence, image building must rely on either ad hoc scripts or using (and installing) a quite substantial configuration-management system.
|
||||
|
||||
突破创建虚拟机(VM)或者图像容器这一领域就变得非常清晰:比如在创建图像的过程中,要么回答关于其的简单问题要么对其进行简单的更改是非常必要的。但是要使工具完成所有的任务需要特殊的处理,这些问题和变化将遇到一些人试图利用脚本精确解决的问题。因此,图像构建要么依靠特定的脚本要么使用(安装)一个相当强大的配置管理系统。
|
||||
|
||||
[Libral][11] establishes a solid foundation for management tools and tasks by providing a common management API across system resources and by making it available through a command line tool, **ralsh**, that enables users to query and to modify system resources in a uniform way, with predictable error reporting. In the above example, checking whether the app user exists is done with **ralsh -aq user app**; checking whether the package **foo** is installed is done with **ralsh -aq package foo**; and, in general, checking whether a resource of type **TYPE** with name **NAME** is present is done with **ralsh -aq TYPE NAME**. Similarly, to create or change an existing user, one runs:
|
||||
|
||||
Libral 将为管理工具和任务提供一个可靠的保证,通过系统资源提供通常管理的 API ,通过命令行工具是制作成为可能,"ralsh",允许用户按照相同的方法查询和修改系统资源,能够有可预见的错误报告。通过以上的举例,通过命令“ralsh -aq user app"检查“app”用户是否存在;通过”ralsh -aq package foo"检查“foo”包文件是否已经被安装;一般情况下,通过命令“ralsh -aq TYPE NAME"检查”NAME“是否是”TYPE“资源类型。类似的,创建和更改存在的用户,可以运行:
|
||||
|
||||
|
||||
```
|
||||
ralsh user app home=/srv/app shell=/sbin/nologin
|
||||
```
|
||||
@ -58,6 +63,9 @@ and to create or change an entry in **/etc/hosts**, one runs:
|
||||
|
||||
In this manner, the user of ralsh is isolated from the fact that these two commands work quite differently internally: The first one needs to use the proper invocation of **useradd** or **usermod**, whereas the second needs to edit the file **/etc/hosts**. For the user, though, they both appear to take the same shape: "Make sure that this resource is in the state that I need."
|
||||
|
||||
|
||||
|
||||
|
||||
### Where to get Libral and how to use it
|
||||
|
||||
Libral is available from [this git repo][12]. Its core is written in C++, and instructions for building it can be found [in the repo][13]. That is only necessary if you actually want to contribute to Libral's C++ core. The Libral site also contains a [prebuilt tarball][14] that can be used on any Linux machine that uses **glibc 2.12** or later. The contents of that tarball can be used both to explore ralsh further and to develop new providers, which give Libral the capability to manage new kinds of resources.
|
||||
|
Loading…
Reference in New Issue
Block a user