Procedural programming defines an ordered series of steps or tasks that configure a target system. In infrastructure as code, the tool executes those steps rather than determining them from a desired end state. section 25.2 section 25.3
The approach is characterized by:
- Explicit sequence: each task is performed in a specified order. section 25.2.1
- Configuration management: playbooks describe Ansible procedures, while Chef recipes group ordered configuration actions into cookbooks. section 25.3 section 25.2.3
- Operational contrast: declarative tools specify a desired end state and determine how to reach it. section 25.2
- Delivery model: procedural Ansible automation commonly uses a control node to push changes over SSH or NETCONF. section 25.2.1
Ansible configuration sequence
Ansible uses an inventory to identify managed hosts, templates and variables to produce configuration files, and a YAML playbook to define tasks. Modules perform individual operations in the playbook’s specified order. section 25.3
Figure 25.5 Basic Ansible operations. Inventory, template, and variable files define configurations, and playbooks define actions. The control node uses SSH to connect and push configurations to managed devices.
Trace the Ansible workflow from inventory, template, and variable files through playbook actions and SSH-based configuration pushes. section 25.2.1
