Extending and embedding Ansible with Python
summary
Shows concrete Python usage: Embedding Ansible with the Python API to run modules and playbooks (demo creates a user and installs packages on localhost), a small Flask REST wrapper to fetch facts, and creating modules with a real tiger issue module submitted to ansible extras that can create and delete issues. Adds dynamic inventory scripts (shelf file example) and several plugins (callback that fires notify send, filter with Caesar rotation). All demos run and produce the claimed effects.
AI-written summary · about
chapters (35)
- 0:00Intro
- 1:24WHAT ANSIBLE IS
- 2:29ARCHITECTURE OVERVIEW
- 3:11HOST FILE (INVENTORY)
- 3:38AD HOC COMMANDS
- 4:10HELLO WORLD!: PING
- 4:47PLAYBOOKS
- 5:51A PLAYBOOK TO DEPLOY NGINX
- 7:30EMBEDDING?
- 9:29ABOUT FACTS
- 9:59EXAMPLE: FLASK FACTER
- 12:22EXAMPLE: INSTALLER
- 14:26EXTENDING?
- 14:57AN ANSIBLE MODULE ..
- 15:32STRUCTURE OF THE MODULE
- 16:23DOCUMENTATION AND EXAMPLES
- 17:13THE PYTHONIC PART
- 18:04THE MAIN() FUNCTION
- 19:12BOILERPLATE CODE
- 19:55MODULE CREATION TIPS
- 20:21MODULE EXAMPLE: TAIGA_ISSUE
- 24:12DYNAMIC INVENTORY SCRIPTS
- 24:33EXAMPLE: SHELVE_INVENTORY
- 25:48CALLBACK PLUGINS
- 27:57LOOKUP PLUGINS
- 28:14LOOKUP PLUGIN BASICS
- 29:38FILTER PLUGINS
- 30:00FILTER PLUGIN BASICS
- 30:14EXAMPLE: ROT13
- 30:51ACTION PLUGINS
- 31:24VARS PLUGINS
- 31:40VARS PLUGIN TEMPLATE CODE
- 31:50CACHE PLUGINS
- 32:19CACHE PLUGIN TEMPLATE CODE
- 34:03REFERENCES








