Red Hat Ansible resources
2 minute read
Red Hat Ansible resources
Latest
2.8.x version
2.6.x version
Training Classes - Videos
Training - Books and Blogs
Ansible Essentials Notes
What is Ansible and the Ansible Way
- An automation language that can describe an IT application infrastructure in Ansible Playbooks
- An automation engine that runs Ansible playbooks
- Ansible is Simple
- Human readable automation
- No special coding skills needed
- Tasks executed in order
- Ansible is Powerful
- Application deployment
- Configuration management
- Workflow orchestration
- Orchestrate the application life cycle
- Multi-tier orchestration
- Provisioning
- Ansible is Agentless
- Agentless architecture
- uses OpenSSH & WinRM
- No agents to exploit or update
- More efficient & more secure
- Ansible is Cross platform
- Agentless support for all major OS variants, physical, virtual, cloud, and network
- Ansible comes bundled with over 450 modules
- Has a popular open source community
- Use Cases
- Configuration Management
- Security and Compliance
- Application Deployment
- Orchestration
- Continuous Delivery
- Provisioning
How Ansible Works
- Ansible’s Automation Engine
- Inventory
- Inventory is a collection of hosts (nodes) against which Ansible can work with
- Hosts
- Groups sources
- Inventory - specific data
- Static or Dynamic
- Inventory can from from providers
- Modules
- Are tools in the toolkit
- Python, Powershell, or any language
- Extend functionality
- API
- Plugins
- Code that plugs into the core engine
- Adaptability for various uses & platforms
- commands (run commands modules - special modules)
- command:
- Takes the command and executes it
- The most secure and predictable
- shell:
- Executes through a shell like /bin/sh
- So you can use pipes,etc
- script:
- Runs a local script on a remote node after transferring it
- raw:
- Executes a command without going through the Ansible module subsystem
- Variable(s)
- Ansible can work with metadata from various sources and manage their context in form of variables
- Variable Precedence
```
- Extra Vars
- Task Vars (only for the task)
- Block vars (only for tasks in the block)
- Role and include vars
- Play vars_files
- Play vars_prompt
- Play vars
- Set_facts
- Registered vars
- Host facts
- Playbook host_vars
- Playbook group_vars
- Inventory host_vars
- Inventory group_vars
- Inventory vars
- Role defaults
```
- Tasks
- Tasks are executed sequentially
- Handler Tasks
- Are special tasks that run at the end of a play if notified by another tasks
- Plays
- Plays are ordered sets of tasks to execute host selections from your inventory
- Playbooks
- A playbook is a file containing one or more plays
- Playbooks are written in YAML
- Roles
- Roles are packages of closely related Ansible content that can be shared more easily than plays alone