Ansible made by mounting a source yum offline

 

Article structure:

           One. Experiment and experiment environment

           two. Outside the network environment download ansible, homemade yum source

           three. Intranet environment installation ansible

 

One. Experiment and experiment environment

1.1 Experimental Background:

Outside the network environment can be directly installed directly ansilbe yum package after installation epel source, but in most cases, in an enterprise environment, the server installation ansible often can not access the Internet, download ansible straightforward installation source, will encounter missing dependencies of various problems, and therefore, recommended production source yum, yum then install ansible.

1.2 Experimental environment:

System Version: CentOS7.6

Kernel version: 3.10.0-957.el7.x86_64

IP Address: 192.168.2.8

1.3 Testing Internet sex together

[root@General ~]# ping baidu.com -c 4

 

 

two. Outside the network environment download ansible, homemade yum source

    The external network environment, prepare a same OS server can connect to the internet (tester outside the network environment as much as possible and the network is consistent and avoid dependencies download failure, caused by installation fails), using yumdownloader Download ansible installation package and all dependencies package.

2.1 Installation Yumdownloader tools (the tools are not installed by default)

[root@General ~]# yum -y install yum-utils

 

2.2 download and install epel source

[General the root @ ~] # yum the install -Y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm   # download source epel

 

2.3. Ansible and download all dependencies

[root@General ~]# yumdownloader --resolve --destdir /root/mypackages/ ansible

 

[root@General ~]# yumdownloader --resolve --destdir /root/mypackages/ createrepo

 

 

three. Intranet environment installation ansible

Download all packages uploaded to the intranet server, make ansible installation. Here To simulate the environment within the network, we will source system comes repo are removed.

 

3.1 Installation creatrepo, making yum source

[root@192 yum.repos.d]# cd /root/mypackages/

[root@192 mypackages]# rpm -ivh createrepo-0.9.9-28.el7.noarch.rpm

# If there installation fails, the other two can be installed in the following figure rpm package

 

3.2 creatrepo generated to meet the requirements of yum warehouse

[root@192 mypackages]# createrepo  /root/mypackages/

 

Local Source 3.3 yum

[root@192 mypackages]# vim /etc/yum.repos.d/ansible.repo

[ansible]

name=ansible

baseurl = file: /// root / mypackages

gpgcheck=0

enabled=1

[root@192 mypackages]# yum clean all && yum repolist

 

3.4 installation ansible, and check the version information

[root@192 mypackages]# yum -y install ansible

[Root @ 192 mypackages] # ansible --version # can check the publication of this information, the installation is successful

 

Guess you like

Origin www.cnblogs.com/scaven-01/p/11735847.html