Vim li cas cov handlers siv hauv Ansible?
Vim li cas cov handlers siv hauv Ansible?

Video: Vim li cas cov handlers siv hauv Ansible?

Video: Vim li cas cov handlers siv hauv Ansible?
Video: Mob nrob qaum/ Mob duav yog vim li cas? 2024, Hlis ntuj nqeg
Anonim

Ansible 2.0

A Tus tuav yuav ua ib qho kev txiav txim thaum hu los ntawm ib qho kev tshwm sim nws mloog. Qhov no yog qhov muaj txiaj ntsig zoo rau kev ua haujlwm thib ob uas yuav tsum tau ua tom qab ua haujlwm, xws li pib qhov kev pabcuam tshiab tom qab kev teeb tsa lossis rov rub tawm qhov kev pabcuam tom qab hloov pauv.

Yog li ntawd, dab tsi yog kev siv cov handlers hauv Ansible?

Cov tuav zoo ib yam li cov dej num tsis tu ncua hauv ib qho Ansible phau ntawv ua si (saib Cov Haujlwm), tab sis tsuas yog khiav yog tias Task muaj "kev ceeb toom" cov lus qhia thiab tseem qhia tau tias nws hloov qee yam. Piv txwv li, yog tias cov ntaub ntawv config raug hloov lawm ces cov hauj lwm referencing config file templating operation yuav ceeb toom rau qhov kev pab cuam pib dua. tus tuav.

Dab tsi yog qhov zoo ntawm kev siv Ansible lub luag haujlwm? Lub luag haujlwm yog tsim los kom rov siv tau. Npaj cov ntawv ua si nrog luag hauj lwm tso cai rau koj rov qab siv cov modules sib txawv thiab zam dhau qhov code duplication. Rov ua dua cov txheej txheem teeb tsa, nqa mus rau hauv cov ntaub ntawv sib cais, tuaj yeem siv tau ntau zaus, tsuas yog suav nrog kev ua haujlwm uas yuav tsum tau ua hauv koj phau ntawv ua si thaum tsim nyog.

Hais txog qhov no, dab tsi yog handlers feem ntau siv rau?

Cov tuav tuaj yeem yog siv rau tej yam uas tsis yog kev pabcuam rov pib dua, tab sis kev pabcuam rov pib dua yog qhov feem ntau kev siv. Tus tswv tsev tsuas yog lub tshuab tej thaj chaw deb uas Ansible tswj hwm. Lawv tuaj yeem muaj qhov sib txawv ntawm tus kheej muab rau lawv, thiab tseem tuaj yeem koom ua pawg.

Dab tsi yog Idempotency hauv Ansible?

Feem ntau, tsis muaj zog yog "cov cuab yeej ntawm qee qhov kev ua haujlwm hauv lej thiab kev tshawb fawb hauv computer uas tuaj yeem siv tau ntau zaus yam tsis hloov qhov tshwm sim dhau ntawm daim ntawv thov thawj zaug". Hauv cov ntsiab lus yooj yim tshaj plaws, tsis muaj zog txhais tau tias koj tuaj yeem paub tseeb ntawm lub xeev zoo ib yam hauv koj ib puag ncig.

Pom zoo: