Ansible Fundamentals
Ansible is an agentless automation tool that configures systems, deploys software, and orchestrates multi-step tasks over SSH or WinRM. You describe desired state in YAML playbooks, and Ansible pushes the necessary changes to target machines without requiring a resident agent.
itInfrastructure and operations | OpenSkills.info
Intro
Ansible Fundamentals
Ansible automates remote systems from a control node. You describe targets in an inventory and desired work in playbooks. Ansible connects to each managed node, runs modules, and reports whether the node changed.
That model separates Ansible from a shell script copied across a fleet. A shell script usually describes commands to execute. An Ansible task usually describes a state to reach. A package should be present. A service should be running. A configuration file should have specific content.
Most Ansible modules inspect the current state before acting. If the desired state already exists, an idempotent module reports no change. Repeated execution should converge on the same result. Idempotency depends on the module and the way you use it; Ansible does not make every command or playbook idempotent.
The operating model
An Ansible environment has three core parts:
- Control node — the system where you install Ansible and run its command-line tools.
- Inventory — one or more sources that identify managed nodes, groups, and associated variables.
- Managed node — a remote host or device that Ansible controls.
Ansible is normally agentless. You do not install an Ansible daemon on every managed node. The control node uses connection plugins and transports such as SSH or PowerShell remoting. Many POSIX modules require Python on the managed node, while some device-specific modules have different requirements.
You can install either ansible-core or the larger ansible package. ansible-core provides the language, runtime, and a built-in set of modules and plugins. The ansible package adds a community-curated collection set. Choose deliberately, then pin the versions of Ansible and any collections that your automation requires.
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://docs.ansible.com/projects/ansible/latest/getting_started/index.html
Supports
- Control node, inventory, and managed node as the three core environment components
- Ansible manages remote systems toward desired state
- https://docs.ansible.com/projects/ansible/latest/getting_started/basic_concepts.html
Supports
- Plays map managed nodes to ordered tasks
- Modules, plugins, collections, roles, and handlers have distinct responsibilities
- Managed nodes do not normally have Ansible installed
- https://docs.ansible.com/projects/ansible/latest/installation_guide/intro_installation.html
Supports
- Agentless control-node architecture and supported transports
- Managed-node runtime requirements and documented exceptions
- ansible-core and Ansible package distinction
- https://docs.ansible.com/projects/ansible/latest/inventory_guide/intro_inventory.html
Supports
- Static and dynamic inventory sources
- Hosts, groups, variables, connection parameters, and multiple group membership
- YAML and INI inventory formats
- https://docs.ansible.com/projects/ansible/latest/inventory_guide/intro_patterns.html
Supports
- Host and group selection through patterns
- Pattern intersection and interaction with command-line limits
- https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_intro.html
Supports
- Ordered play and task execution
- Fully qualified collection name recommendation
- Desired state, idempotency, execution results, and verification options
- https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_variables.html
Supports
- Variable definitions, scope, use in playbooks, and Jinja expressions
- https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_vars_facts.html
Supports
- Facts as discovered managed-node data exposed through variables
- Fact gathering, disabling, and caching concepts
- https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_handlers.html
Supports
- Handlers run when changed tasks notify them
- Notification deduplication and handler execution timing
- Change reporting controls operational reactions
- https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_checkmode.html
Supports
- Check mode and diff mode behavior
- Limits for unsupported modules and registered-result dependencies
- Sensitive-data risk in diff output
- https://docs.ansible.com/projects/ansible/latest/reference_appendices/general_precedence.html
Supports
- Configuration, command-line, keyword, variable, and direct-assignment precedence categories
- ansible.cfg search order and first-file behavior
- Extra variables as high-precedence values
- https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_reuse_roles.html
Supports
- Role directory structure and reusable content categories
- Role defaults, variables, tasks, handlers, files, and templates
- https://docs.ansible.com/projects/ansible/latest/collections_guide/index.html
Supports
- Collections as namespaced distributions of playbooks, roles, modules, and plugins
- Collection installation and use through distribution servers
- https://docs.ansible.com/projects/ansible/latest/vault_guide/index.html
Supports
- Ansible Vault encryption for variables and files at rest
- Limits of Vault protection after content is decrypted
- https://docs.ansible.com/projects/ansible/latest/cli/ansible-playbook.html
Supports
- Current syntax-check, list-hosts, list-tasks, check, diff, limit, tags, become, and verbosity options
- ansible-playbook executes defined tasks on targeted hosts
- https://docs.ansible.com/projects/ansible/latest/cli/ansible.html
Supports
- Ad hoc module execution, inventory selection, module arguments, and verbosity options
- Version output and CLI configuration discovery
- https://docs.ansible.com/projects/ansible/latest/cli/ansible-config.html
Supports
- Inspecting effective configuration and changed settings
- https://docs.ansible.com/projects/ansible/latest/cli/ansible-doc.html
Supports
- Inspecting installed module and plugin documentation
- https://docs.ansible.com/projects/ansible/latest/cli/ansible-inventory.html
Supports
- Displaying inventory as a graph, list, or host-specific view
- https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/ping_module.html
Supports
- Verifying login and usable remote Python rather than ICMP reachability
- https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/package_module.html
Supports
- Generic package state management and supported state values
- https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/file_module.html
Supports
- File, directory, link, ownership, mode, and absence management
- https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/copy_module.html
Supports
- Copying static content with destination ownership and mode controls
- https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/template_module.html
Supports
- Rendering Jinja templates to managed-node destinations
- https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/service_module.html
Supports
- Service state and enablement management
- https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/user_module.html
Supports
- User account state, group, and shell management
- https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/setup_module.html
Supports
- Gathering managed-node facts
- https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/assert_module.html
Supports
- Asserting playbook preconditions and invariants
- https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_error_handling.html
Supports
- changed_when and failed_when semantics
- Unreachable and failed host behavior and forced handlers
- https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_tags.html
Supports
- Selecting or skipping tagged plays and tasks
- https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_privilege_escalation.html
Supports
- Become plugins, methods, users, credentials, and task or play scope
