Merge pull request #16466 from geekpi/translating

translated
This commit is contained in:
geekpi 2019-11-28 08:57:57 +08:00 committed by GitHub
commit 9ef4b0747d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 64 additions and 64 deletions

View File

@ -7,41 +7,42 @@
[#]: via: (https://www.linuxtechi.com/install-ansible-centos-8-rhel-8/)
[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/)
How to Install Ansible (Automation Tool) on CentOS 8/RHEL 8
如何在 CentOS 8/RHEL 8 上安装 Ansible自动化工具
======
**Ansible** is an awesome automation tool for Linux sysadmins. It is an open source configuration tool which allows sysadmins to manage hundreds of servers from one centralize node i.e **Ansible Server**. Ansible is the preferred configuration tool when it is compared with similar tools like **Puppet**, **Chef** and **Salt** because it doesnt need any agent and it works on SSH and python.
**Ansible** 是给 Linux 系统管理员使用的出色自动化工具。它是一种开源配置工具,能让系统管理员可以从一个中心节点(即 **Ansible 服务器**)管理数百台服务器。将 Ansible 与 **Puppet**、**Chef** 和 **Salt**等类似工具进行比较时,它是首选的配置工具,因为它不需要任何代理,并且可以工作在 SSH 和 python 上。
[![Install-Ansible-CentOS8-RHEL8][1]][2]
In this tutorial we will learn how to install and use Ansible on CentOS 8 and RHEL 8 system
在本教程中,我们将学习如何在 CentOS 8 和 RHEL 8 系统上安装和使用 Ansble
Ansible Lab Details:
Ansible 实验环境信息:
* Minimal CentOS 8 / RHEL 8 Server (192.168.1.10) with Internet Connectivity
* Two Ansible Nodes Ubuntu 18.04 LTS (192.168.1.20) & CentOS 7 (192.168.1.30)
* Minimal CentOS 8 / RHEL 8 服务器192.168.1.10),且有互联网连接
* 两个 Ansible 节点 - Ubuntu 18.04 LTS 192.168.1.20 和 CentOS 7 192.168.1.30
### Ansible Installation steps on CentOS 8 
### CentOS 8 上的 Ansible 安装步骤
Ansible package is not available in default CentOS 8 package repository. so we need to enable [EPEL Repository][3] by executing the following command,
Ansible 包不在 CentOS 8 默认的软件包仓库中。因此,我们需要执行以下命令启用 [EPEL 仓库][3]
```
[root@linuxtechi ~]$ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y
```
Once the epel repository is enabled, execute the following dnf command to install Ansible
启用 epel 仓库后,执行以下 dnf 命令安装 Ansble。
```
[root@linuxtechi ~]$ sudo dnf install ansible
```
Output of above command :
上面命令的输出:
![dnf-install-ansible-centos8][1]
Once the ansible is installed successfully, verify its version by running the following command
成功安装 ansible 后,运行以下命令验证它的版本。
```
[root@linuxtechi ~]$ sudo ansible --version
@ -49,39 +50,39 @@ Once the ansible is installed successfully, verify its version by running the fo
![Ansible-version-CentOS8][1]
Above output confirms that Installation is completed successfully on CentOS 8.
上面的输出确认在 CentOS 8 上安装完成。
Lets move to RHEL 8 system
让我们看下 RHEL 8 系统。
### Ansible Installation steps on RHEL 8
### RHEL 8 上的 Ansible 安装步骤
If you have a valid RHEL 8 subscription then use following subscription-manager command to enable Ansible Repo,
如果你有有效的 RHEL 8 订阅,请使用以下订阅管理器命令启用 Ansble 仓库,
```
[root@linuxtechi ~]$ sudo subscription-manager repos --enable ansible-2.8-for-rhel-8-x86_64-rpms
```
Once the repo is enabled then execute the following dnf command to install Ansible,
启用仓库后,执行以下 dnf 命令安装 Ansible
```
[root@linuxtechi ~]$ sudo dnf install ansible -y
```
Once the ansible and its dependent packages are installed then verify ansible version by executing the following command,
安装 ansible 及其依赖包后,执行以下命令来验证它的版本,
```
[root@linuxtechi ~]$ sudo ansible --version
```
### Alternate Way to Install Ansible via pip3 on CentOS 8 / RHEL 8
### 在 CentOS 8 / RHEL 8 上通过 pip3 安装 Ansible 的可选方法
If you wish to install Ansible using **pip** (**pythons package manager**) then first install pyhton3 and python3-pip packages using following command,
如果你希望使用 **pip**python 的包管理器)安装 Ansible请首先使用以下命令安装 pyhton3 和 python3-pip 包,
```
[root@linuxtechi ~]$ sudo dnf install python3 python3-pip -y
```
After pyhthon3 installation, verify its version by running
安装 python3 后,运行以下命令来验证它的版本。
```
[root@linuxtechi ~]$ python3 -V
@ -89,23 +90,23 @@ Python 3.6.8
[root@linuxtechi ~]$
```
Now run below pip3 command to install Ansible,
命令下面的 pip3 命令安装 Ansible
```
[root@linuxtechi ~]$ pip3 install ansible --user
```
Output,
输出,
![Ansible-Install-pip3-centos8][1]
Above output confirms that Ansible has been installed successfully using pip3. Lets see how we can use Ansible
上面的输出确认 Ansible 已成功使用 pip3 安装。让我们看下如何使用 Ansible。
### How to Use Ansible Automation Tool?
### 如何使用 Ansible 自动化工具?
When we install Ansible using yum or dnf command then its configuration file, inventory file and roles directory created automatically under /etc/ansible folder.
当我们使用 yum 或 dnf 命令安装 Ansible 时,它的配置文件、清单文件和角色目录会自动在 /etc/ansible 文件夹下创建。
So, lets add a group with name “**labservers**” and under this group add ubuntu 18.04 and CentOS 7 Systems ip address in **/etc/ansible/hosts** file
让我们添加一个名称为 “**labservers**” 的组,并在 **/etc/ansible/hosts** 文件中给该组添加 Ubuntu 18.04 和 CentOS 7 的系统 IP 地址。
```
[root@linuxtechi ~]$ sudo vi /etc/ansible/hosts
@ -116,9 +117,10 @@ So, lets add a group with name “**labservers**” and under this group add
```
Save & exit file.
保存并退出文件。
Once the inventory file (/etc/ansible/hosts) is updated then exchange your users ssh public keys with remote systems which are part of “labservers” group.
更新清单文件(/etc/ansible/hosts将用户的 ssh 公钥与作为 “”组一部分的远程系统交换。
Lets first generate your local users public and private key using ssh-keygen command,

View File

@ -7,48 +7,48 @@
[#]: via: (https://www.linuxtechi.com/install-virtualbox-6-centos-8-rhel-8/)
[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/)
How to Install VirtualBox 6.0 on CentOS 8 / RHEL 8
如何在 CentOS 8 / RHEL 8 上安装 VirtualBox 6.0
======
**VirtualBox** is a free and open source **virtualization tool** which allows techies to run multiple virtual machines of different flavor at the same time. It is generally used at desktop level (Linux and Windows), it becomes very handy when someone try to explore the features of new Linux distribution or want to install software like **OpenStack**, **Ansible** and **Puppet** in one VM, so in such scenarios one can launch a VM using VirtualBox.
**VirtualBox** 是一款免费的开源**虚拟化工具**它允许技术人员同时运行多个不同风格的虚拟机。它通常用于运行桌面Linux 和 Windows当人们尝试探索新的 Linux 发行版的功能或希望在 VM 中安装 **OpenStack**、**Ansible** 和 **Puppet** 等软件时,它会非常方便,在这种情况下,我们可以使用 VirtualBox 启动 VM。
VirtualBox is categorized as **type 2 hypervisor** which means it requires an existing operating system, on top of which VirtualBox software will be installed. VirtualBox provides features to create our own custom host only network and NAT network. In this article we will demonstrate how to install latest version of VirtualBox 6.0 on CentOS 8 and RHEL 8 System and will also demonstrate on how to install VirtualBox Extensions.
VirtualBox 被分类为**2 类虚拟机管理程序**,这意味着它需要一个现有的操作系统,在上面安装 VirtualBox 软件。VirtualBox 提供功能来创建本机网络或 NAT 网络。在本文中,我们将演示如何在 CentOS 8 和 RHEL 8 系统上安装最新版本的 VirtualBox 6.0,并演示如何安装 VirtualBox 扩展。
### Installation steps of VirtualBox 6.0 on CentOS 8 / RHEL 8
### 在 CentOS 8 / RHEL 8 上安装 VirtualBox 6.0 的安装步骤
#### Step:1) Enable VirtualBox and EPEL Repository
#### 步骤 1 启用 VirtualBox 和 EPEL 仓库
Login to your CentOS 8 or RHEL 8 system and open terminal and execute the following commands to enable VirtualBox and EPEL package repository.
登录到你的 CentOS 8 或 RHEL 8 系统并打开终端,执行以下命令并启用 VirtualBox 和 EPEL 包仓库。
```
[root@linuxtechi ~]# dnf config-manager --add-repo=https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo
```
Use below rpm command to import Oracle VirtualBox Public Key
使用以下 rpm 命令导入 Oracle VirtualBox 公钥
```
[root@linuxtechi ~]# rpm --import https://www.virtualbox.org/download/oracle_vbox.asc
```
Enable EPEL repo using following dnf command,
使用以下 dnf 命令启用 EPEL 仓库,
```
[root@linuxtechi ~]# dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y
```
#### Step:2) Install VirtualBox Build tools and dependencies
#### 步骤 2 安装 VirtualBox 构建工具和依赖项
Run the following command to install all VirtualBox build tools and dependencies,
运行以下命令来安装所有 VirtualBox 构建工具和依赖项,
```
[root@linuxtechi ~]# dnf install binutils kernel-devel kernel-headers libgomp make patch gcc glibc-headers glibc-devel dkms -y
```
Once above dependencies and build tools are installed successfully then proceed with VirtualBox installation using dnf command,
成功安装上面的依赖项和构建工具后,使用 dnf 命令继续安装 VirtualBox
#### Step:3) Install VirtualBox 6.0 on CentOS 8 / RHEL 8
#### 步骤 3 在 CentOS 8 / RHEL 8 上安装 VirtualBox 6.0
If wish to list available versions of VirtualBox before installing it , then execute the following [dnf command][1],
如果希望在安装之前列出 VirtualBox 的可用版本,请执行以下 [dnf 命令][1]
```
[root@linuxtechi ~]# dnf search virtualbox
@ -59,72 +59,71 @@ VirtualBox-6.0.x86_64 : Oracle VM VirtualBox
[root@linuxtechi ~]#
```
Lets install latest version of VirtualBox 6.0 using following dnf command,
让我们使用以下 dnf 命令安装最新版本的 VirtualBox 6.0
```
[root@linuxtechi ~]# dnf install VirtualBox-6.0 -y
```
If any local user want to attach usb device to VirtualBox VMs then he/she should be part “**vboxuser**s ” group, use the beneath usermod command to add local user to “vboxusers” group.
如果有本地用户希望将 usb 设备连接到 VirtualBox VM那么他/她应该是 “**vboxusers**” 组的一员,请使用下面的 usermod 命令将本地用户添加到 “vboxusers” 组。
```
[root@linuxtechi ~]# usermod -aG vboxusers pkumar
```
#### Step:4) Access VirtualBox on CentOS 8 / RHEL 8
#### 步骤 4 访问 CentOS 8 / RHEL 8 上的 VirtualBox
There are two ways to access VirtualBox, from the command line type “**virtualbox**” then hit enter
有两种方法可以访问 VirtualBox在命令行输入 “**virtualbox**” 然后回车:
```
[root@linuxtechi ~]# virtualbox
```
From Desktop environment, Search “VirtualBox” from Search Dash.
在桌面环境中,在搜索框中搜索 “VirtualBox”。
[![Access-VirtualBox-CentOS8][2]][3]
Click on VirtualBox icon,
单击 VirtualBox 图标,
[![VirtualBox-CentOS8][2]][4]
This confirms that VirtualBox 6.0 has been installed successfully, lets install its extension pack.
这确认 VirtualBox 6.0 已成功安装,让我们安装它的扩展包。
#### Step:5) Install VirtualBox 6.0 Extension Pack
#### 步骤 5 安装 VirtualBox 6.0 扩展包
As the name suggests, VirtualBox extension pack is used to extend the functionality of VirtualBox. It adds the following features:
顾名思义VirtualBox 扩展包用于扩展 VirtualBox 的功能。它添加了以下功能:
* USB 2.0 & USB 3.0 support
* Virtual RDP (VRDP)
* Disk Image Encryption
* Intel PXE Boot
* Host WebCam
* USB 2.0 和 USB 3.0 支持
* 虚拟 RDPVRDP
* 磁盘镜像加密
* Intel PXE 启动
* 主机网络摄像头
Use below wget command to download virtualbox extension pack under download folder,
使用下面的 wget 命令下载 Virtualbox 扩展包到下载文件夹中,
```
[root@linuxtechi ~]$ cd Downloads/
[root@linuxtechi Downloads]$ wget https://download.virtualbox.org/virtualbox/6.0.14/Oracle_VM_VirtualBox_Extension_Pack-6.0.14.vbox-extpack
```
Once it is downloaded, access VirtualBox and navigate **File** >**Preferences** > **Extension** then click on + icon to add downloaded extension pack,
下载后,打开 VirtualBox 并依次点击 **File** >**Preferences** > **Extension**,然后点击 “+” 号图标添加下载的扩展包,
[![Install-VirtualBox-Extension-Pack-CentOS8][2]][5]
Click on “Install” to start the installation of extension pack.
单击 “Install” 开始安装扩展包。
[![Accept-VirtualBox-Extension-Pack-License-CentOS8][2]][6]
Click on “I Agree” to accept VirtualBox Extension Pack License.
单击 "I Agree" 接受 VirtualBox 扩展包许可证。
After successful installation of VirtualBox extension pack, we will get following screen, Click on Ok and start using VirtualBox.
成功安装 VirtualBox 扩展包后,我们将看到下面的页面,单击 OK 并开始使用 VirtualBox。
[![VirtualBox-Extension-Pack-Install-Message-CentOS8][2]][7]
Thats all from this article, I hope these steps help you install VirtualBox 6.0 on your CentOS 8 and RHEL 8 system. Please do share your valuable feedback and comments.
**Also Read**: **[How to Manage Oracle VirtualBox Virtual Machines from Command Line][8]**
本文就是这些了,我希望这些步骤可以帮助你在 CentOS 8 和 RHEL 8 系统上安装 VirtualBox 6.0。请分享你的宝贵反馈和意见。
* [Facebook][9]
* [Twitter][10]
@ -139,7 +138,7 @@ via: https://www.linuxtechi.com/install-virtualbox-6-centos-8-rhel-8/
作者:[Pradeep Kumar][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
@ -153,7 +152,6 @@ via: https://www.linuxtechi.com/install-virtualbox-6-centos-8-rhel-8/
[5]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Install-VirtualBox-Extension-Pack-CentOS8.jpg
[6]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Accept-VirtualBox-Extension-Pack-License-CentOS8.jpg
[7]: https://www.linuxtechi.com/wp-content/uploads/2019/11/VirtualBox-Extension-Pack-Install-Message-CentOS8.jpg
[8]: https://www.linuxtechi.com/manage-virtualbox-virtual-machines-command-line/
[9]: http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.linuxtechi.com%2Finstall-virtualbox-6-centos-8-rhel-8%2F&t=How%20to%20Install%20VirtualBox%206.0%20on%20CentOS%208%20%2F%20RHEL%208
[10]: http://twitter.com/share?text=How%20to%20Install%20VirtualBox%206.0%20on%20CentOS%208%20%2F%20RHEL%208&url=https%3A%2F%2Fwww.linuxtechi.com%2Finstall-virtualbox-6-centos-8-rhel-8%2F&via=Linuxtechi
[11]: http://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.linuxtechi.com%2Finstall-virtualbox-6-centos-8-rhel-8%2F&title=How%20to%20Install%20VirtualBox%206.0%20on%20CentOS%208%20%2F%20RHEL%208