1.9 KiB
1.9 KiB
EX407-Ansible-Automation
Red Hat Certified Specialist in Ansible Automation (EX407) Preparation Course
Understanding Core Components of Ansible
Understanding Core Components of Ansible Part 1
This series of lessons lays the foundation for the remainder of the course content. Through a combination of lecture and command line demonstration, Students will gain a broad overview of Ansible. This particular lesson, focuses on Ansible inventories.
- Overview
- Invetories
- Modules
- Variables
- Facts
- Plays
- Playbooks
- Configuration files
Inventories
-
Inventory files may simply consist of a list of hostnames but can be much more robust
-
It is also possible to define groups of hosts, host or group level variables, and groups of groups withing the inventory
-
There are a number of variables that may be used within the inventory to control how ansible connects to and interacts with target hosts
-
Commands to call ansible with
pingmodule:ansible innaghiyev1c.mylabserver.com -m ping -k- call ping module oninnaghiyev1c.mylabserver.comhost. Where-m pingis ping module and-kis key for asking passwordansible all -m ping -k- call all defined hosts in your inventory list/etc/ansible/hosts/ansible -i inv.ini httpd -m ping -k- where-i- inventory file place,httpdhosts group name inside ofinv.inifile
Output:
innaghiyev1c.mylabserver.com | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"ping": "pong"
}
