Dab tsi yog qhov tseeb hauv Ansible?
Dab tsi yog qhov tseeb hauv Ansible?

Video: Dab tsi yog qhov tseeb hauv Ansible?

Video: Dab tsi yog qhov tseeb hauv Ansible?
Video: Dab tsi yog qhov tseeb txog cov tshuaj tiv thaiv COVID-19? 2024, Kaum ib hlis
Anonim

Tsuas tso tseg, Qhov tseeb tiag yog cov cuab yeej system uas tau sau los ntawm Ansible thaum nws ua haujlwm ntawm qhov chaw taws teeb. Cov qhov tseeb muaj cov ntsiab lus tseem ceeb xws li kev cia khoom thiab kev teeb tsa network txog lub hom phiaj.

Hais txog qhov no, siv Gather_facts hauv Ansible yog dab tsi?

Qhov module no tau raug hu los ntawm cov ntawv ua si los sau cov txiaj ntsig sib txawv ntawm cov chaw taws teeb tswj uas tuaj yeem ua tau siv hauv phau ntawv ua si. Nws tseem tuaj yeem raug tua ncaj qha los ntawm /usr/bin/ ansible txhawm rau txheeb xyuas seb qhov hloov pauv twg muaj rau tus tswv tsev. Ansible muab ntau qhov tseeb txog qhov system, txiav.

Tom qab, lo lus nug yog, Hostvars Ansible yog dab tsi? hostvars yog hash nrog cov khoom muag hostnames ua tus yuam sij. Txhawm rau nkag mus rau thaj chaw ntawm txhua tus tswv tsev, siv hostvars ['test-1'], ib hostvars ['test2-1'], thiab lwm yam. ansible_ssh_host yog deprecated rau ansible_host txij thaum 2.0.

Ua li no, Inventory_hostname hauv Ansible yog dab tsi?

inventory_hostname - Raws li configured nyob rau hauv lub ansible cov ntaub ntawv khoom muag (eg: /etc/ ansible /hosts). Nws tuaj yeem yog qhov chaw nyob IP lossis lub npe uas tuaj yeem daws tau los ntawm DNS. ansible_hostname - Raws li pom los ntawm ansible . Ansible ssh 's rau hauv tus tswv tsev thiab sau qee qhov tseeb.

Ansible Group_vars ua haujlwm li cas?

Ansible siv kev sib txuas ntawm cov ntaub ntawv hosts thiab a group_vars directory los rub cov variables rau ib pawg host thiab khiav Ansible plays/ua hauj lwm tawm tsam hosts. group_vars /tag nrho yog siv los teev variables uas yuav yuav siv tau rau txhua tus tswv tsev uas Ansible yog khiav tawm tsam.

Pom zoo: