Ansible no es una fiesta para ti. Sergey Pechenko

Te sugiero que leas la decodificación del informe de 2019 de Sergey Pechenko "Ansible, ¡esto no es para ti!"



Algunas palabras sobre mi.



Ingeniero. Sé algo sobre TI y estoy listo para compartir este conocimiento. Como las personas que tienen preguntas específicas; no les gusta la gente que quiere que alguien haga todo por ellos.



Breve resumen de la historia:


  • Preparando el suelo.
  • («bashsible»).
  • ?
  • , .
  • .
  • .
  • .
  • Jinja, !


Ansible, . .



-, . Ansible . . – . , Ansible <.. group_vars> . yaml, - , Git, . . . Ansible 5 , .



< > . 2.1, – , , . , , , - .


– . AWS. Ansible , . . .



– , Ansible @pro_ansible.



— . , , , Ansible. , . : « ?». , , .



. . , – , Ansible.


Ansible , . , . , . Ansible, , , . , – , , , , . .


, .



, Ansible, Ansible. . 4 . , , . – , - . – . - «play» — , . «Playbook» — . 2 play playbook.


Ansible «all». , . Ansible — inventory. , . , . , , inventory , . . < > all, 2, 3, host3 <>. , . , ?


. . – ? , , ? , ? «» «».



. . . , . , , «» «».


– 80% 20% , . 20% 80% . , .



, , . Ansible . Python .


Python , Python - . Ansible . .


, Python, . , . , , Senoir YAML Developer.


, , . – . , , , . , , .



. , , , (« »). , - , , .


, , , , . , inventory, , . YaML, Senior YaML Developer, « Ansible» — , .


, . Ansible , , — . «library». . . , , – Python , , , . .


Python- - « » — - « », «module_utils». , . , . .



. ? , , – . , , , IT, , , . . GPL'. . . , exception .


? Ansible. , , . . exceptions, , . . – . , , . . , , , , , .



. Changed = False. , changed – ok. . message, . – - .


. , Ansible’ «». «host_vars». «host_vars[_]» . Ansible.


? , , ansible_facts - host_vars , . Controller , host_vars.


set_fact - . . , - , - . Python-, .


AnsibleModule, . Argument_spec – , . : « -, -». argument_spec Ansible , , ; , «» . , . , . , , .



Ansible. . , - 2.4, , , , Grafana'. - «uri», bashsible, — shell, curl, JSON c Grafana' . , , Grafana' .


, , . , — , . . , «_spec», . , «file», , : , owner, group, chmod. , c . , , . .


, — - , , Ansible, , . : – .


Ansible aliases (<>). «grafana_url» «url» — . , . «required = true». - . .


, Grafana. ? . .



argument_spec, , . , check_mode.


, check_mode? . : , , . , , production.


production ? , . check_mode? , production. , — - . , 100 . ? , check_mode .


, , check_mode, Grafana . : Grafana, , .


, . «required_together», Ansible , , . — , Ansible , .


mutually_exclusive, . . : , , . . , . - , , , , , .


exception, .


— production , . Ansible. , - , . .



. . , , . action plugins, callback plugins .. , «*_plugins» library " ". , , .


Ansible . , , . — , .



action-. - < >. : tasks, assert . , . .



. , , - . Python- c if __name__ == '__main__', . . : , «run». Ansible . , .. , .


import Ansible, – action-.



— , , . , . — .



? - . Jinja. Jinja2 (2.10). , , Ansible.



Jinja . , . .


– , , , . . , .


– . , - Jinja, - , . , Ansible , . . , .


, , Jinja2 . , . , . Jinja .



– , , . - . , .


. – cache behavior = merge. . . – «combine». «combine», .



? , . group_vars/all – , - , . . group1, group2.


, «all». – hostvars. , . . - , , . . , .



№2 – . , , . , .



? . YaML Jinja. — «from_yaml» — .



, ! , Ansible , . ?


. , . ? , , Ansible, Ansible 2.4. . , «uri», REST API, Consul'. , key-value Ansible. . . backend , « ». curl — , - . , «library», requests , backend'. .


. c Zabbix - . , , . . . < >, , . , Zabbix « ».

. , Ansible .


, . – - daemon, , . «agentless» Ansible – SSH, . , , .

. : , , Ansible Tower?


Ansible Tower , , , – , .


OpenSource .


OpenSource – AWX.


.


-, , - AWX , , . Ansible- . Ansible CI/CD, jobs, Jenkins, , , Rundeck. , shell-, ansible-playbook .


, DevOps Ansible , , ?


job, , Jenkins , job . job. . . .


?


.


! , , ? , , - . , - .


-, ansible-lint, . , . ? ansible-lint? – . .


. . ?


— molecule.


! Ansible. Linux . , . , - , .


, . , , Ansible, , 5 ? , - -. , open-source’ ( napalm).


Linux .


Cisco , .


Terraform – , ?


Tuve experiencia Ansible sin un montón de Terraform. Fue un despliegue, fue Amazon, fueron cinco regiones. Cuando después de dos regiones dijeron que se necesitaba un tercero, agregué varias líneas y las desplegué.


Vídeo:



All Articles