1. ansible主機(jī)清單的配置
城固網(wǎng)站制作公司哪家好,找創(chuàng)新互聯(lián)建站!從網(wǎng)頁(yè)設(shè)計(jì)、網(wǎng)站建設(shè)、微信開(kāi)發(fā)、APP開(kāi)發(fā)、成都響應(yīng)式網(wǎng)站建設(shè)公司等網(wǎng)站項(xiàng)目制作,到程序開(kāi)發(fā),運(yùn)營(yíng)維護(hù)。創(chuàng)新互聯(lián)建站2013年開(kāi)創(chuàng)至今到現(xiàn)在10年的時(shí)間,我們擁有了豐富的建站經(jīng)驗(yàn)和運(yùn)維經(jīng)驗(yàn),來(lái)保證我們的工作的順利進(jìn)行。專(zhuān)注于網(wǎng)站建設(shè)就選創(chuàng)新互聯(lián)建站。
? ? 以下是ansible安裝完成后的源文件
[root@test-1?~]#?cat?/etc/ansible/hosts ????#?This?is?the?default?ansible?'hosts'?file. ????# ????#?It?should?live?in?/etc/ansible/hosts ????# ????#???-?Comments?begin?with?the?'#'?character ????#???-?Blank?lines?are?ignored ????#???-?Groups?of?hosts?are?delimited?by?[header]?elements ????#???-?You?can?enter?hostnames?or?ip?addresses ????#???-?A?hostname/ip?can?be?a?member?of?multiple?groups ???? ????#?Ex?1:?Ungrouped?hosts,?specify?before?any?group?headers. ????[webservers] ????192.168.200.131??ansible_host_user=root?ansible_host_pass='123456' ????192.168.200.132 ????192.168.200.133 ????192.168.200.134 ????192.168.200.135 ????192.168.200.136 ???? ????##?green.example.com ????##?blue.example.com ????##?192.168.100.1 ????##?192.168.100.10 ???? ????#?Ex?2:?A?collection?of?hosts?belonging?to?the?'webservers'?group ???? ????##?[webservers] ????##?alpha.example.org ????##?beta.example.org ????##?192.168.1.100 ????##?192.168.1.110 ???? ????#?If?you?have?multiple?hosts?following?a?pattern?you?can?specify ????#?them?like?this: ???? ????##?www[001:006].example.com ???? ????#?Ex?3:?A?collection?of?database?servers?in?the?'dbservers'?group ???? ????##?[dbservers] ????##? ????##?db01.intranet.mydomain.net ????##?db02.intranet.mydomain.net ????##?10.25.1.56 ????##?10.25.1.57 ???? ????#?Here's?another?example?of?host?ranges,?this?time?there?are?no ????#?leading?0s: ???? ????##?db-[99:101]-node.example.com
2. ansible定義方式:
1) 直接指明主機(jī)地址或主機(jī)名
test_2.xxxx.cn2????????? 192.168.200.132
?? 2) 定義一個(gè)主機(jī)組 [ ?組名 ?] ?把地址或主機(jī)名加進(jìn)去
[webservers] ????????192.168.200.131??ansible_host_user=root?ansible_host_pass='123456' ????????192.168.200.132 ????????192.168.200.133 ????????192.168.200.134 ????????192.168.200.135 ????????192.168.200.136
?3) 如果你沒(méi)有使用公鑰,想要使用密碼,你也可以這樣寫(xiě)(適用于第一次登陸控制)
格式:【主機(jī)名】???????【指定用戶】????【主機(jī)地址】???【主機(jī)密碼】 [webservers] 192.168.200.131????ansible_host_user=root????test-1=192.168.200.131??????ansible_host_pass='123456'
當(dāng)前名稱(chēng):ansible-主機(jī)清單的配置
文章URL:http://www.chinadenli.net/article10/ggipgo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站改版、網(wǎng)站設(shè)計(jì)、Google、網(wǎng)站導(dǎo)航、標(biāo)簽優(yōu)化、網(wǎng)站排名
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)