Redhat7.4ansible2.4.3.0离线安装指南

上传人:痛*** 文档编号:84743675 上传时间:2022-05-04 格式:DOC 页数:12 大小:186.50KB
返回 下载 相关 举报
Redhat7.4ansible2.4.3.0离线安装指南_第1页
第1页 / 共12页
Redhat7.4ansible2.4.3.0离线安装指南_第2页
第2页 / 共12页
Redhat7.4ansible2.4.3.0离线安装指南_第3页
第3页 / 共12页
点击查看更多>>
资源描述
ansible离线安装指南1前言RHEL Lin ux环境an sible的安装在有In ternet网络环境的情况下, 可以通过pip、部署yum源后使用yum安装或者采用离线包安装集中方式进行,在没有网络环境的情况下,一般只能采用离线包安装,本文即介绍这种安装方式。本文作者cdshrewd不保证该方式符合最佳实践,只记录作者的实验过程,如有疑问请联系:cdshrewd.2基础环境说明及准备本次测试涉及两台服务器,一台是控制机,一台是被控测试机。相关信息如下:控制机被控测试机机器名an sible01an sible02IP192.168.2.20192.168.2.30操作系统版本Red Hat En terprise LinuxRed Hat En terprise Linux ServerServer release 7.4 (Maipo)release 7.4 (Maipo)ansible软件位置/opt/a nsibleN/Apytho n版本Pyth on 2.7.5Pyth on 2.7.5ansible 版本2.4.3.0N/Aansible相关软件包及版本信息如下:an sible-2.4.3.0 asn 1crypto-0.24.0 bcrypt-3.1.4 cffi-1.11.4 cryptography-2.0.3 ecdsa-0.13en um34-1.1.6 idn a-2.6 ipaddress-1.0.19 Jinja2-2.9.6markupsafe-masterparamiko-2.3.0pyas n1-0.4.2pycparser-2.18pycrypto-2.6.1PyNaCI-1.2.1PyYAML-3.12setuptools-36.5.0simplejs on-3.13.2sshpass-1.06yaml-0.1.7操作系统需要安装的rpm包主要有以下几个,建议采用yum安装:gccpyth on-develope nssl-devel libffi-devel zlib-devel libyaml3 ansible及相关包安装3.1离线文件上传将所有以下安装包上传到/opt/ansible目录下。an sible-2.4.3.0.tar.gzasn 1crypto-0.24.0.tar.gzbcrypt-3.1.4.tar.gzcffi-1.11.4.tar.gzcryptography-2.0.3.tar.gzecdsa-0.13.tar.gzenu m34-1.1.6.tar.gzidn a-2.6.tar.gzipaddress-1.0.19.tar.gzJinja2-2.9.6.tar.gzmarkupsafe-master.zipparamiko-2.3.0.tar.gzpyas n1-0.4.2.tar.gzpycparser-2.18.tar.gzpycrypto-2.6.1.tar.gzPyNaCI-1.2.1.tar.gzPyYAML-3.12.tar.gz setuptools-3650.zip simplejs on-3.13.2.tar.gz sshpass-1.06.tar.gz yaml-0.1.7.tar.gz3.2依赖包安装1. setuptoolscd /opt/a nsibleun zip setuptools-3650.zip cd setuptools-36.5.0pyth on setup.py in stall2. pycryptocd /opt/a nsibletar -xzvf pycrypto-2.6.1.tar.gz cd pycrypto-2.6.1 pyth on setup.py in stall3. yamlcd /opt/a nsibletar -xzvf yaml-0.1.7.tar.gzcd yaml-0.1.7./con figuremake -jobs=grep processor /proc/cpu info | wc -lmake in stall4. PyYAMLcd /opt/a nsibletar -xzvf PyYAML-3.12.tar.gzcd PyYAML-3.12pyth on setup.py in stall5. MarkupSafecd /opt/a nsibleun zip markupsafe-master.zip cd markupsafe-master pyth on setup.py in stall6. ecdsa cd /opt/a nsibletar -xzvf ecdsa-0.13.tar.gzcd ecdsa-0.13pyth on setup.py in stall7. pyasn1cd /opt/a nsibletar -xzvf pyas n1-0.4.2.tar.gzcd pyas n1-0.4.2pyth on setup.py in stall8. pycparsercd /opt/a nsibletar -xzvf pycparser-2.18.tar.gz cd pycparser-2.18 pyth on setup.py in stall9. cfficd /opt/a nsibletar -xzvf cffi-1.11.4.tar.gzcd cffi-1.11.4pyth on setup.py in stall10. PyNaClcd /opt/a nsibletar -xzvf PyNaCI-1.2.1.tar.gzcd PyNaCl-1.2.1pyth on setup.py in stall11. ipaddresscd /opt/a nsibletar -xzvf ipaddress-1.0.19.tar.gz cd ipaddress-1.0.19 pyth on setup.py in stall12. enu m34cd /opt/a nsibletar -xzvf enu m34-1.1.6.tar.gzcd en um34-1.1.6pyth on setup.py in stall13. asn1cryptocd /opt/a nsibletar -xzvf asn 1crypto-0.24.0.tar.gz cd as n1crypto-0.24.0 pyth on setup.py in stall14. idnacd /opt/a nsibletar -xzvf idn a-2.6.tar.gzcd idn a-2.6pyth on setup.py in stall15. cryptographycd /opt/a nsibletar -xzvf cryptography-2.0.3.tar.gz cd cryptography-2.0.3 pyth on setup.py in stall16. bcryptcd /opt/a nsibletar -xzvf bcrypt-3.1.4.tar.gzcd bcrypt-3.1.4pyth on setup.py in stall17. paramikocd /opt/a nsibletar -xzvf paramiko-2.3.0.tar.gz cd paramiko-2.3.0pyth on setup.py in stall18. simplejsoncd /opt/a nsibletar -xzvf simplejs on-3.13.2.tar.gz cd simplejso n-3.13.2pyth on setup.py in stall3.3 安装 ansiblecd /opt/a nsibletar -xzvf an sible-2.4.3.0.tar.gzcd an sible-2.4.3.0pyth on setup.py in stall byte-compiling build/bdist.linux-x86_64/egg/ansible/utils/module_docs_fragments/oneview.py to on eview.pycbyte-compil ing build/bdist.li nu x-x86_64/egg/a nsible/utils/module_docs_fragme nts/ope nstack.py to ope nstack.pycbyte-compil ingbuild/bdist.li nu x-x86_64/egg/a nsible/utils/module_docs_fragme nts/ope nswitch.py toope nswitch.pycbyte-compiling build/bdist.linux-x86_64/egg/ansible/utils/module_docs_fragments/ovirt.py to ovirt.pycbyte-compil ingbuild/bdist.li nu x-x86_64/egg/a nsible/utils/module_docs_fragme nts/ovirt_facts.py to ovirt_facts.pycbyte-compil ing build/bdist.li nu x-x86_64/egg/a nsible/utils/module_docs_fragme nts/postgres.py to postgres.pycbyte-compil ing build/bdist.li nu x-x86_64/egg/a nsible/utils/module_docs_fragme nts/purestorage.py to purestorage.pycbyte-compil ingbuild/bdist.li nu x-x86_64/egg/a nsible/utils/module_docs_fragme nts/rackspace.py to rackspace.pycbyte-compil ingbuild/bdist.li nu x-x86_64/egg/a nsible/utils/module_docs_fragme nts/return_com mon .py to retur n_com mon .pycbyte-compil ing build/bdist.li nu x-x86_64/egg/a nsible/utils/module_docs_fragme nts/sros.py to sros.pycbyte-compil ing build/bdist.li nu x-x86_64/egg/a nsible/utils/module_docs_fragme nts/tower.py to tower.pycbyte-compiling build/bdist.linux-x86_64/egg/ansible/utils/module_docs_fragments/validate.py to validate.pycbyte-compiling build/bdist.linux-x86_64/egg/ansible/utils/module_docs_fragments/vca.py to vca.pycbyte-compiling build/bdist.linux-x86_64/egg/ansible/utils/module_docs_fragments/vmware.py to vmware.pycbyte-compiling build/bdist.linux-x86_64/egg/ansible/utils/module_docs_fragments/vyos.py to vyos.pycbyte-compil ing build/bdist.linux-x86_64/egg/ansible/vars/_init_.py to _init_.pyc byte-compil ing build/bdist.li nu x-x86_64/egg/a nsible/vars/hostvars.py to hostvars.pyc byte-compil ing build/bdist.li nu x-x86_64/egg/a nsible/vars/ma nager.py to man ager.pyc byte-compil ing build/bdist.li nu x-x86_64/egg/a nsible/vars/reserved.py to reserved.pyc byte-compil ing build/bdist.li nu x-x86_64/egg/a nsible/vars/un safe_proxy.py to un safe_proxy.pyc creat ing build/bdist.li nu x-x86 64/egg/EGG-INFOin stalli ng scripts to build/bdist.li nux-x86_64/egg/EGG-INFO/scripts running in stall_scripts running build_scripts creating build/scripts-2.7copying and adjusting bin/ansible - build/scripts-2.7 copying and adjusting bin/ansible-playbook - build/scripts-2.7 copying and adjusting bin/ansible-pull - build/scripts-2.7 copying and adjusting bin/ansible-doc - build/scripts-2.7 copying and adjusting bin/ansible-galaxy - build/scripts-2.7 copy ing and adjust ing bin/an sible-c on sole - build/scripts-2.7 copying and adjusting bin/ansible-connection - build/scripts-2.7 copying and adjusting bin/ansible-vault - build/scripts-2.7 cha nging mode of build/scripts-2.7/a nsible from 644 to 755 cha nging mode of build/scripts-2.7/a nsible-playbook from 644 to 755 cha nging mode of build/scripts-2.7/a nsible-pull from 644 to 755 cha nging mode of build/scripts-2.7/a nsible-doc from 644 to 755 cha nging mode of build/scripts-2.7/a nsible-galaxy from 644 to 755 cha nging mode of build/scripts-2.7/a nsible-c on sole from 644 to 755 cha nging mode of build/scripts-2.7/a nsible-c onnection from 644 to 755 cha nging mode of build/scripts-2.7/a nsible-vault from 644 to 755 creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts copying build/scripts-2.7/ansible - build/bdist.linux-x86_64/egg/EGG-INFO/scripts copying build/scripts-2.7/ansible-connection - build/bdist.linux-x86_64/egg/EGG-INFO/scripts copying build/scripts-2.7/ansible-config - build/bdist.linux-x86_64/egg/EGG-INFO/scripts copying build/scripts-2.7/ansible-console - build/bdist.linux-x86_64/egg/EGG-INFO/scripts copying build/scripts-2.7/ansible-doc - build/bdist.linux-x86_64/egg/EGG-INFO/scripts copying build/scripts-2.7/ansible-galaxy - build/bdist.linux-x86_64/egg/EGG-INFO/scripts copying build/scripts-2.7/ansible-inventory - build/bdist.linux-x86_64/egg/EGG-INFO/scripts copying build/scripts-2.7/ansible-playbook - build/bdist.linux-x86_64/egg/EGG-INFO/scripts copying build/scripts-2.7/ansible-pull - build/bdist.linux-x86_64/egg/EGG-INFO/scripts copying build/scripts-2.7/ansible-vault - build/bdist.linux-x86_64/egg/EGG-INFO/scripts cha nging mode of build/bdist.li nu x-x86_64/egg/EGG-INFO/scripts/a nsible to 755 cha nging mode of build/bdist.li nu x-x86_64/egg/EGG-INFO/scripts/a nsible-c onn ectio n to 755 cha nging mode of build/bdist. lin ux-x86_64/egg/EGG-INFO/scripts/a nsible-co nfig to 755 changing mode of build/bdist. lin ux-x86_64/egg/EGG-INFO/scripts/a nsible-co nsole to 755 cha nging mode of build/bdist. lin ux-x86_64/egg/EGG-INFO/scripts/a nsible-doc to 755 cha nging mode of build/bdist.li nu x-x86_64/egg/EGG-INFO/scripts/a nsible-galaxy to 755 cha nging mode of build/bdist.li nux-x86_64/egg/EGG-INFO/scripts/a nsible-i nven tory to 755 cha nging mode of build/bdist. lin ux-x86_64/egg/EGG-INFO/scripts/a nsible-playbook to 755 changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/ansible-pull to 755 cha nging mode of build/bdist.li nu x-x86 64/egg/EGG-INFO/scripts/a nsible-vault to 755copying lib/ansible.egg-info/PKG-INFO - build/bdist.linux-x86_64/egg/EGG-INFOcopy ing lib/a nsible.egg-i nfo/SOURCES.txt - build/bdist.li nux-x86_64/egg/EGG-INFOcopy ing lib/a nsible.egg-i nfo/depe nde ncy_li nks.txt - build/bdist. lin ux-x86_64/egg/EGG-INFO copying lib/ansible.egg-info/requires.txt - build/bdist.linux-x86_64/egg/EGG-INFO copying lib/ansible.egg-info/top_level.txt - build/bdist.linux-x86_64/egg/EGG-INFO zip_safe flag not set; an alyz ing archive conten ts.ansible.cli._init_: module referen ces _file_ansible.cli._init_: module referen ces _path_an sible.c on fig.ma nager: module references _file_an sible.executor.module_com mon: module referen ces _file_ansible.galaxy._init_: module references _file_an sible.module_utils.basic: module refere nces _file_an sible.module_utils.gcp: module refere nces _file_ansible.module_utils.six._init_: module references _path_an sible.modules.cloud.amaz on. ec2_elb_lb: module referen ces _file_an sible.modules.cloud.amazo n. elb_classic_lb: module refere nces _file_an sible.modules.files. un archive: module refere nces _file_an sible.modules.packagi ng.os.apt: module refere nces _file_an sible.modules.utilities.logic.as yn c_wrapper: module references _file_an sible.plugi ns.lo ader: module refere nces _file_ansible.plugins.callback._init_: module referen ces _file_an sible.plugi ns.callback.osx_say: module references _file_ creati ng distcreating dist/ansible-2.4.3.0-py2.7.egg and adding build/bdist.linux-x86_64/egg to it removi ng build/bdist.li nu x-x86_64/egg (and everyth ing un der it)Process ing an sible-2.4.3.0-py2.7.eggcreati ng /usr/lib/pyth on 2.7/site-packages/a nsible-2.4.3.0-py2.7.eggExtract ing an sible-2.4.3.0-py2.7.egg to /usr/lib/pytho n2.7/site-packagesAdding ansible 2.4.3.0 to easy-install.pth fileIn stall ing an sible script to /usr/b inIn stall ing an sible-c onnection script to /usr/b inIn stall ing an sible-c onfig script to /usr/b inIn stall ing an sible-c on sole script to /usr/b inIn stall ing an sible-doc script to /usr/b inIn stall ing an sible-galaxy script to /usr/b inIn stall ing an sible-i nven tory script to /usr/b inIn stall ing an sible-playbook script to /usr/b inIn stall ing an sible-pull script to /usr/b inIn stall ing an sible-vault script to /usr/b inIn stalled /usr/lib/pyth on 2.7/site-packages/a nsible-2.4.3.0-py2.7.eggProcess ing depe nden cies for an sible=2.4.3.0Search ing for setuptools=36.5.0Best match: setuptools 36.5.0Process ing setuptools-36.5.0-py2.7.eggsetuptools 36.5.0 is already the active version in easy-i nstall.pthIn stall ing easy_i nstall script to /usr/b inInstalling easy_install-2.7 script to /usr/binUsing /usr/lib/pyth on 2.7/site-packages/setuptools-36.5.0-py2.7.eggSearch ing for cryptography=2.1.4Best match: cryptography 2.1.4Process ing cryptography-2.1.4-py2.7-li nu x-x86_64.egg cryptography 2.1.4 is already the active vers ion in easy-i nstall.pthUsing /usr/lib64/python2.7/site-packages/cryptography-2.1.4-py2.7-linux-x86_64.egg Search ing for paramiko=2.3.0Best match: paramiko 2.3.0Process ing paramiko-2.3.0-py2.7.eggparamiko 2.3.0 is already the active version in easy-i nstall.pthUsing /usr/lib/pyth on 2.7/site-packages/paramiko-2.3.0-py2.7.eggSearchi ng for PyYAML=3.12Best match: PyYAML 3.12Adding PyYAML 3.12 to easy-install.pth fileUsing /usr/lib64/pyth on 2.7/site-packagesSearchi ng for Jinja2=2.9.6Best match: Jinja2 2.9.6Process ing Jinja2-2.9.6-py2.7.eggJinja2 2.9.6 is already the active vers ion in easy-i nstall.pthUsing /usr/lib/pyth on 2.7/site-packages/Jinja2-2.9.6-py2.7.eggSearch ing for six=1.9.0Best match: six 1.9.0Adding six 1.9.0 to easy-install.pth fileUsing /usr/lib/pyth on 2.7/site-packagesSearch ing for asn 1crypto=0.24.0Best match: asn 1crypto 0.24.0Process ing asn 1crypto-0.24.0-py2.7.eggasn 1crypto 0.24.0 is already the active version in easy-i nstall.pthUsing /usr/lib/pyth on 2.7/site-packages/as n1crypto-0.24.0-py2.7.eggSearch ing for idn a=2.6Best match: idna 2.6Process ing idn a-2.6-py2.7.eggidna 2.6 is already the active version in easy-i nstall.pthUs ing /usr/lib/pyth on 2.7/site-packages/id na-2.6-py2.7.eggSearch ing for pyas n1=0.4.2Best match: pyas n1 0.4.2Process ing pyas n1-0.4.2-py2.7.eggpyas n1 0.4.2 is already the active version in easy-i nstall.pthUsing /usr/lib/pyth on 2.7/site-packages/pyas n1-0.4.2-py2.7.eggSearchi ng for PyNaCI=1.2.1Best match: PyNaCl 1.2.1Processi ng PyNaCl-1.2.1-py2.7-li nu x-x86_64.eggPyNaCl 1.2.1 is already the active version in easy-i nstall.pthUsing /usr/lib64/python2.7/site-packages/PyNaCl-1.2.1-py2.7-linux-x86_64.eggSearch ing for bcrypt=3.1.4Best match: bcrypt 3.1.4Processi ng bcrypt-3.1.4-py2.7-li nux-x86_64.eggbcrypt 3.1.4 is already the active vers ion in easy-i nstall.pthUsing /usr/lib64/python2.7/site-packages/bcrypt-3.1.4-py2.7-linux-x86_64.eggSearchi ng for MarkupSafe=1.0Best match: MarkupSafe 1.0Processi ng MarkupSafe-1.0-py2.7-li nu x-x86_64.eggMarkupSafe 1.0 is already the active version in easy-i nstall.pthUsi ng /usr/lib64/pytho n2.7/site-packages/MarkupSafe-1.0-py2.7-li nux-x86_64.eggSearch ing for cffi=1.11.4Best match: cffi 1.11.4Processi ng cffi-1.11.4-py2.7-li nux-x86_64.eggcffi 1.11.4 is already the active version in easy-i nstall.pthUsing /usr/lib64/python2.7/site-packages/cffi-1.11.4-py2.7-linux-x86_64.eggSearch ing for pycparser=2.18Best match: pycparser 2.18Addi ng pycparser 2.18 to easy-i nstall.pth fileUsing /usr/lib/pyth on 2.7/site-packagesFini shed process ing depe nden cies for an sible=2.4.3.04 ansible配置4.1生成公钥/私钥roota nsible01 bin# ssh-keyge n -t rsa -P Gen erati ng public/private rsa key pair.En ter file in which to save the key (/root/.ssh/id_rsa):Created directory /root/.ssh.Your identification has been saved in /root/.ssh/id_rsa.Your public key has bee n saved in /root/.ssh/id_rsa.pub.The key fingerprint is:SHA256:22zbQPbSp26eaC+PYPoco Hn tNOc3Amgto+HM+FUZJOs roota nsible01The keys ran domart image is:+-RSA 2048+|E .|. *|.oSo|.o=+o* o|=o+ooO.B o.|. =o * B+B+|. .+.=XO.| +SHA256+roota nsible01 bin # cat /root/.ssh/id_rsa.pub /root/.ssh/authorized_keysrootansible01 bin# chmod 600 /root/.ssh/authorized keys写入信任文件(将/root/.ssh/id_rsa.pub分发到其他服务器,并在所有服务器上执行如下指 令):cat /root/.ssh/id_rsa.pub /root/.ssh/authorized_keyschmod 600 /root/.ssh/authorized keys4.2配置1. 生成ansible配置文件rootansibleOl ansible-2.4.3.0# mkdir -p /etc/ansibleroota nsible01 an sible-2.4.3.0# cp /opt/a nsible/a nsible-2.4.3.0/examples/a nsible.cfg /etc/a nsible/2. 配置文件 /etc/ansible/hostsvi /etc/a nsible/hostslocal127.0.0.1target192.168.2.20192.168.2.305测试1. ping模块测试roota nsible01 an sible-2.4.3.0# an sible all -m pi ng -ask-passSSH password:192.168.2.20 | SUCCESS = cha nged: false,pi ng: p ong127.0.0.1 | SUCCESS = cha nged: false,pi ng: p ong192.168.2.30 | SUCCESS = cha nged: false,pi ng: p ongroota nsible01 an sible-2.4.3.0#2. comma nd模块测试roota nsible01 an sible-2.4.3.0# an sible target -m comma nd -auptime192.168.2.30 | SUCCESS | rc=0 10:17:34 up 1:00,2 users, load average: 0.03, 0.02, 0.05192.168.2.20 | SUCCESS | rc=0 10:17:34 up 1:01,2 users, load average: 0.12, 0.09, 0.06roota nsible01 an sible-2.4.3.0#3. 用户模块测试roota nsible01 an sible-2.4.3.0# an sible target -m user -a n ame=cds comme nt=hello,cds192.168230 | SUCCESS = appe nd: false, cha nged: false, comme nt: hello,cds, group: 1001, home: /home/cds, move_home: false, n ame: cds, shell: /b in/bash, state: prese nt, uid: 1001192.168.2.20 | SUCCESS = cha nged: true, comme nt: hello,cds, createhome: true, group: 1001, home: /home/cds, n ame: cds, shell: /b in/bash, state: prese nt, system: false, uid: 1001
展开阅读全文
相关资源
相关搜索

最新文档


当前位置:首页 > 图纸专区 > 成人自考


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!