Ansible Introduction Flashcards
What tasks can be done with Ansible?
- fetch data from devices
- copy files to/from devices
- install software on devices
- configure software on devices
What is a feature of Ansible that ensires that execution of changes is predictable?
Ansible can run “dry run” showing the potential changes
The ansible software package consists of 3 major components. What are they?
- CLI tools that drive the automation engine (e.g. playbook, ansible doc)
- DSL language that Ansible is written in
- madular packaging and publishing framework for Ansible automation
What is the language in which the Ansible domains are written in and how are they structured?
Domain-Specific Language (DSL); structured in YAML
In what language are the Ansible tools written?
the tools run Python software that interprets various files defining how the IT infrastructure should operate
What are collections and what do they allow to do?
modular packaging framework that allow to write, reuse and share Ansible automation with others
What are other automation tools that are similar in nature?
Puppet, Chef, SlatStack
Does Ansible need an agent to be installed?
no
What authentication methods can Ansible leverage?
TACAS+, RADIUS, LDAP (existing auhtentication methods)
How is Ansible executed when run against a Linux server?
copies Python software to the Linux server using SFTP or SCP and executes the software on the server itself
How is Ansible executed when run against a a network device?
Python software is executed on the Ansible Control Node - ensure it has enough resources, as the script is executed locally
What is a Porting Guide?
document breaking changes to help to prepare automation for future Ansible releases; major releases include breaking changes that are not backwards compatible
What is a Changelog?
similar to Porting Guide, but very detailed; lists all changes made between two releases
What is the Control Node?
machine with Ansible software installed that executes Ansible automation against Managed Nodes
What is a Managed Node, also commonly referred to as Host?
a host that Ansible automation executes against
Can a Control Node act as Host at the same time?
yes, it’s possible to execute scripts against the managing machine that deploys scripts
What is Ansible Inventory File?
text file that specifies the hosts and groups of hosts that Ansible will manage - serves as a way to define the target systems or devices on which Ansible will execute tasks and playbooks
What is Ansible Playbook?
configuration file written in YAML that defines a set of tasks, roles, and configurations to be applied to one or more target hosts
What do playbook consist of?
one or more tasks, each represented as a YAML dictionary - each task defines an action to be executed on the target hosts
What are Handlers?
special tasks in playbooks that are triggered only when certain conditions are met; commonly used for tasks like restarting services after a configuration change
What are Ansible Modules?
small, self-contained scripts or programs that Ansible uses to perform specific tasks on target hosts or remote systems
What are system facts?
variables that provide information about the system, such as the operating system, network interfaces, memory, disk space, etc
Which dictionary provides a common way to specify connection information for network modules in Ansible?
provider:
What is inventory_hostname
?
built-in variable in Ansible that refers to the hostname of the current target in the inventory (inventory is the host file with devices where the config is deployed)
What is ansible_host
?
- variable used to specify the actual hostname or IP address to connect to if it differs from the inventory hostname
- choice between
inventory_hostname
andansible_host
depends on inventory setup and whether the hostnames in inventory file match the actual hostnames or IP addresses of the hosts