ansible offline package production and offline deployment

1, the same OS prepare a server can connect to the Internet using yumdownloader Download ansible installation package and all dependencies.
Yumdownloader installation tool as root:
yum install yum-utils
Create a folder
mkdir /root/packages
There is no default source ansible, you need to install fedora epel Source:
yum install epel-release -y
Download ansible and all dependencies
yumdownloader --resolve --destdir /root/packages/ ansible
yumdownloader --resolve --destdir /root/packages/ createrepo
 
2, the last step to download all rpm installation package packaged, transmitted to the enterprise server environment, to extract / packages folder.
First install createrepo:
cd /packages
Because createrepo dependent deltarpm and python-deltarpm two packages, two packets need to install
rpm -ivh deltarpm-xxxx.x86_64.rpm
rpm -ivh python-deltarpm-xxxx.x86_64.rpm
Install createrepo:
rpm -ivh createrepo-xxxx.noarch.rpm
Then use createrepo generated to meet the requirements of yum repository, execute:
createrepo /packages
 
3, to configure the local source yum
we /etc/yum.repos.d/yum.repo
[test]
name=myyum
baseurl = file: /// packages
gpgcheck=0
enabled=1
Save and exit, then execute:
yum clean all
yum repolist
 
4, the installation with yum ansible
yum install ansible
Verify successful installation:
ansible --version
ansible xxx
 
Good text to the top  follow me  The paper collection   

Guess you like

Origin www.cnblogs.com/fanlong0212/p/12185290.html