Blog
Thoughts on engineering, design, and building great products.
Optimization and Execution Strategy
Running Ansible fast and safely across hundreds of hosts: forks and strategy control parallelism, serial for zero-downtime rolling updates, delegate_to/run_once, async for long tasks, fact caching and pipelining for speed, tags and check mode for control.
Extending Ansible: Filter, Lookup, and Callback Plugins
Modules extend the work done on the host; plugins extend Ansible itself, running on the control node. This article: filter plugins (transform data in Jinja2), lookup plugins (fetch external data), callback plugins (customize output), and the module vs plugin distinction.
Writing a Custom Module in Python
Deep dive: write your own Ansible module in Python. Understand AnsibleModule, argument_spec, exit_json/fail_json, supporting check_mode, and the pattern for achieving idempotency. This is where the mechanism from Article 1 (shipping a module over SSH) comes full circle.
Ansible Vault: Managing Secrets
Passwords and API keys can't sit in plaintext in Git. Ansible Vault encrypts secrets with AES256, decrypting automatically at run time. This article: encrypt/view/edit secret files, encrypt_string for individual values, using them in a playbook, and best practices.
Ansible Galaxy and Collections
Ansible's modern packaging and distribution: a collection bundles modules, roles, and plugins under one namespace; FQCN for explicit calls; installing collections from Galaxy with requirements.yml; and distinguishing ansible-core from the full ansible package.
Roles: Organizing Reusable Code
As a playbook grows, you need organization. A role is how Ansible packages tasks, handlers, templates, and variables into a reusable unit with a standard directory structure. This article: create a role with ansible-galaxy init, fill it in, and use it in a playbook.
Handlers, Loops and Conditionals
Control playbook flow: loop to repeat a task over many values, when to run conditionally, handlers to react to changes (restart on config change), and block/rescue for clean error handling. With real run logs.