{"id":3697,"date":"2018-11-09T06:27:54","date_gmt":"2018-11-08T22:27:54","guid":{"rendered":"http:\/\/switch.linesno.com\/?p=3697"},"modified":"2018-11-09T08:20:09","modified_gmt":"2018-11-09T00:20:09","slug":"ansible-tower%e8%a3%85%e4%bb%a5%e5%8f%8a%e7%a0%b4%e8%a7%a3","status":"publish","type":"post","link":"http:\/\/switch.linesno.com\/?p=3697","title":{"rendered":"ansible-tower\u88c5\u4ee5\u53ca\u7834\u89e3"},"content":{"rendered":"<p>\u4e00\u3001\u73af\u5883\u51c6\u5907\uff1a<br \/>\nCentOS Linux release 7.5.1804 (Core)<br \/>\n\u4e3b\u673a\u5730\u5740:9.110.187.203<br \/>\nansible\u7248\u672c:2.6.4<br \/>\nansible-tower\u7248\u672c:3.2.6<\/p>\n<p>[root@localhost ~]#yum -y install ansible<\/p>\n<p>[root@localhost ~]# ansible &#8211;version<\/p>\n<p>ansible 2.6.4<\/p>\n<p>\u4e8c\u3001\u5b89\u88c5ansible-tower:<\/p>\n<p>[root@localhost ~]#wget\u00a0<a href=\"https:\/\/releases.ansible.com\/ansible-tower\/setup-bundle\/ansible-tower-setup-bundle-3.2.6-1.el7.tar.gz\">https:\/\/releases.ansible.com\/ansible-tower\/setup-bundle\/ansible-tower-setup-bundle-3.2.6-1.el7.tar.gz<\/a><\/p>\n<p>[root@localhost ~]#tar -zxvf ansible-tower-setup-bundle-3.2.6-1.el7.tar.gz<\/p>\n<p>[root@localhost ~]#cd ansible-tower-setup-bundle-3.2.6-1.el7<\/p>\n<p>\u4fee\u6539\u914d\u7f6e\u6587\u4ef6inventory\u5c06\u91cc\u9762\u6240\u6709\u7684\u5bc6\u7801\u90fd\u4fee\u6539\u4e3a\u81ea\u5df1\u7684\u5bc6\u7801,\u5982\u4e0b\u4e09\u5904\u7684\u6807\u7ea2\u5730\u65b9<span style=\"color: #333333;\">:<\/span><\/p>\n<p>[root@localhost ansible-tower-setup-bundle-3.2.6-1.el7]# pwd<\/p>\n<p>\/root\/ansible-tower-setup-bundle-3.2.6-1.el7<\/p>\n<p><img title=\"1540293679109921.png\" alt=\"image.png\" \/><\/p>\n<p>[root@localhost ansible-tower-setup-bundle-3.2.6-1.el7]# .\/setup.sh<\/p>\n<p>\u5982\u679c\u7f51\u7edc\u6ca1\u6709\u95ee\u9898\u7684\u8bdd\u8010\u5fc3\u7b49\u5f85\u5b89\u88c5\u5b8c\u6210\u5373\u53ef.<\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u6ca1\u62a5\u9519\u7684\u8bdd\u5373\u53ef\u8bbf\u95eeweb\u9875\u9762:https:\/\/9.110.187.203\/#\/,\u9ed8\u8ba4\u521d\u59cb\u9875\u9762\u5982\u4e0b:<\/p>\n<p>\u9ed8\u8ba4\u7528\u6237\u4e3aadmin,\u5bc6\u7801\u4e3ainventory\u6587\u4ef6admin_password\u5b57\u6bb5\u914d\u7f6e\u7684\u5bc6\u7801,\u6211\u8fd9\u91cc\u914d\u7f6e\u7684\u5bc6\u7801\u4e5f\u4e3aadmin.<\/p>\n<p>\u5bfc\u5165license,\u6ca1\u6709\u7684\u8bdd,\u70b9\u51fbREQUEST LICENSE,\u53bb\u5b98\u65b9(https:\/\/www.ansible.com\/license)\u7533\u8bf7\u514d\u8d39\u8bd5\u7528,\u586b\u5199\u4e2a\u4eba\u4fe1\u606f\u540e(\u90ae\u7bb1\u8981\u586b\u5199\u6b63\u786e,\u5176\u4ed6\u4fe1\u606f\u53ef\u968f\u4fbf\u586b\u5199)\u4f1a\u628alicense\u53d1\u5230\u586b\u5199\u7684\u90ae\u7bb1.<\/p>\n<p>\u63d0\u4ea4license\u5e76\u767b\u5f55\u6210\u529f\u540e\u9ed8\u8ba4\u521d\u59cb\u9875\u9762\u5982\u4e0b:<\/p>\n<p>[root@localhost ansible-tower-setup-bundle-3.2.6-1.el7]# cd \/var\/lib\/awx\/venv\/awx\/lib\/python2.7\/site-packages\/tower_license<\/p>\n<p>vi __init__.py\u5c06119\u884c\u548c120\u884c\u4fee\u6539\u4e3a\u5982\u4e0b\u5185\u5bb9,\u7279\u522b\u9700\u8981\u6ce8\u610f\u683c\u5f0f,\u5982\u4e0b:<\/p>\n<p>\u5373\uff1a_check_cloudforms_subscription\uff0c\u6dfb\u52a0return True<\/p>\n<p>\u4fee\u6539\u5b8c\u91cd\u65b0\u7f16\u8bd1\u4e00\u4e0b:<\/p>\n<p>[root@localhost\u00a0 tower_license]# python -m py_compile __init__.py<\/p>\n<p>[root@localhost\u00a0 tower_license]# python -O -m py_compile __init__.py<\/p>\n<p>\u91cd\u542f\u670d\u52a1:<\/p>\n<p>[root@localhost\u00a0 tower_license]# ansible-tower-service restart<\/p>\n<p>\u91cd\u65b0\u6253\u5f00settings\u2013VIEW YOUR LICENSE,\u53d1\u73b0&#8221;Hosts Available&#8221;\u53d8\u6210\u4e869999999\u53f0,\u8bf4\u660e\u7834\u89e3\u6210\u529f<\/p>\n<p><audio style=\"display: none;\" controls=\"controls\"><\/audio><\/p>\n<p><audio style=\"display: none;\" controls=\"controls\"><\/audio><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u73af\u5883\u51c6\u5907\uff1a CentOS Linux release 7.5.1804 (Core) \u4e3b\u673a\u5730\u5740:9.110 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[72,7],"tags":[],"class_list":["post-3697","post","type-post","status-publish","format-standard","hentry","category-python","category-day"],"_links":{"self":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/3697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3697"}],"version-history":[{"count":2,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/3697\/revisions"}],"predecessor-version":[{"id":3706,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/3697\/revisions\/3706"}],"wp:attachment":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3697"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}