Installing a non-base package
In this section we are going to create a repository to host non-base packages. As a given example, we are going to install the Ansible package.
Note
It is not necessary to install Ansible on the compute nodes, this is just an example.
First, let us check the information of the ansible
package:
[root@master ~]# yum info ansible
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.sonn.com
* epel: archive.linux.duke.edu
* extras: linux.cc.lehigh.edu
* updates: centos.mirror.constant.com
Available Packages
Name : ansible
Arch : noarch
Version : 2.7.8
Release : 1.el7
Size : 11 M
Repo : epel/x86_64
Summary : SSH-based configuration management, deployment, and task execution system
URL : http://ansible.com
License : GPLv3+
Description : Ansible is a radically simple model-driven configuration management,
: multi-node deployment, and remote task execution system. Ansible works
: over SSH and does not require any software or daemons to be installed
: on remote nodes. Extension modules can be written in any language and
: are transferred to managed machines automatically.
Note that the ansible
package belongs to the EPEL repository (Repo
), and therefore will not be available for installation on the compute nodes. As well as in the previous section, we will download the package ansible
and all of this dependencies, inside a different folder (local_epel
):
[root@master ~]# mkdir local_epel
[root@master ~]# cd local_epel
[root@master local_epel]# repotrack ansible
The command repotrack
will automatically download ansible
and all of this dependencies. After the downloads are completed, create the repository, add it to Cobbler’s database and synchronize it. As explained before, to make persistent the fact that we want this repository in the compute nodes after reinstallation, we will add it to the centos7-x86_64
profile:
[root@master local_epel]# createrepo .
[root@master local_epel]# cobbler repo add --name=local_epel --mirror=/root/local_epel
[root@master local_epel]# cobbler reposync --only=local_epel
[root@master local_epel]# cobbler profile edit --name=centos7-x86_64 --repo="minimal local_epel"
[root@master local_epel]# cobbler sync
Note that the --repo
option must contain all the repositories you intent to use in the profile. Check the profile’s report:
[root@master local_epel]# cobbler profile report --name=centos7-x86_64
Name : centos7-x86_64
TFTP Boot Files : {}
...
...
Repos : ['minimal', 'local_epel']
Server Override : <<inherit>>
Template Files : {}
...
If you want to install the package without reimaging the nodes, it is necessary to add the new repository information into the yum configuration on the compute nodes. Add the following lines to /etc/yum.repos.d/cobbler-config.repo
[local_epel]
name=local_epel
baseurl=http://192.168.16.1/cobbler/repo_mirror/local_epel
enabled=1
gpgcheck=0
priority=1
Update and install ansible
[root@c01 ~]# yum update
[root@c01 ~]# yum install ansible