Automation Tools: Ansible
Let's learn how to use Ansible in the network automation process and try out some simple commands.
We'll cover the following...
Ansible is the automation engine where playbooks are run, either in
check mode or full execution mode. Running playbooks is as simple as
creating a YAML file and running the ansible-playbook
command in the
Linux host.
The syntax for ansible-playbook
is as follows:
ansible-playbook <playbook file name.yml> <options>
Some common options:
-
–ask-vault-pass
: Ask for the vault password. -
-C
,--check
: Do not make changes; instead, try to predict some of the changes that occur. -
-D
,--diff
: When changing (small) files and templates, show the differences in those files; works great with--check
. -
-l SUBSET
,--limit=SUBSET
: Further limit selected hosts to an additional pattern. ...