官术网_书友最值得收藏!

Red Hat, CentOS, and Fedora package installation

If you are using Yellowdog Updater, Modified (Yum), you will have an extra step, since Ansible is not located in the default RHEL repositories. As you may have experienced when installing tools in the past, the Extra Package for Enterprise Linux (EPEL) is often required to be installed before you can use the package manager to install the tools. This is a very straightforward step. We first need to download the epel-release rpm file from the Fedora Project website: http://fedoraproject.org/wiki/EPEL. We then need to install it using rpm as follows:

sudo rpm -i epel-release-latest-7.noarch.rpm
Tools downloaded from EPEL are not actually tested by Red Hat quality engineers, therefore extra care should be taken when downloading on production servers it as may disrupt support.

The Ansible engine repository (available at https://access.redhat.com/articles/3174981) is another valid repository to download the latest releases from Ansible. To access its packages using Red Hat Linux only, we first need to enable it as follows:

sudo subsription-manager repos --enable rhel-7-server-ansible-2.5-rpms

After that, the package manager will need to update its cache, the package list. We use Yum to do so, as follows:

sudo yum update

Just like installing any other package using Yum, we need to specify ansible as the input for the install option:

sudo yum install ansible

Most of the Red Hat family operating systems should accept those commands to set up Ansible. Fedora 18 and later versions have a next-generation package manager, Dandified Yum (DNF). This is currently the default package manager from Fedora 22 and onwards. After installing the EPEL package using RPM, we need to run the following command to update the DNF package list:

sudo dnf -y update

We then install Ansible using the following command:

sudo dnf -y install ansible

Using the Red Hat family of operating systems, Ansible installation can be done by getting the appropriate RPM file and installing it using RPM. First, we need to download the appropriate RPM file from the Ansible releases link: https://releases.ansible.com/ansible/rpm/. Download the RPM file with the desired Ansible version and install it as follows:

sudo rpm -Uvh ansible-2.5.5-1.el7.ans.noarch.rpm

If needed, RPM files can also be built and installed from a source easily. We recommend using the official GitHub Ansible repository. Firstly, we need to get the project folder using Git. We may need to have Git installed already to be able to download it easily:

git clone https://github.com/ansible/ansible.git
cd ansible

Then, we need to build the Ansible rpm file and install it using the same command: 

make rpm
sudo rpm -Uvh rpm-build/ansible-*.noarch.rpm
主站蜘蛛池模板: 元阳县| 紫阳县| 兴宁市| 十堰市| 衢州市| 江北区| 河南省| 大竹县| 庆阳市| 宣恩县| 独山县| 嘉荫县| 珲春市| 西峡县| 屯昌县| 正宁县| 金溪县| 吴桥县| 桦南县| 大姚县| 德惠市| 台东市| 奉贤区| 天台县| 云龙县| 华坪县| 银川市| 林口县| 延庆县| 黑河市| 安图县| 海口市| 玛多县| 青铜峡市| 南汇区| 丰台区| 西安市| 甘泉县| 扶沟县| 伊金霍洛旗| 恭城|