Chapter 3 How to Automate the Network?

For diagrams, tables, or exact code formatting, .

JOHN W. CAPOBIANCOPRINTED PAGE 52

Explore the repository. automateyournetwork@LINUX HOST:~/Production-Infrastructure$ ls WSL and DrvFS Microsoft WSL and DrvFS can be used to set the permissions using traditional Linux chmod commands. If errors are encountered when running Ansible playbooks in Windows particularly because the ansible.cfg file has world write permissions, use the following instructions to open chmod capabilities in Ubuntu:

First unmount the drive. sudo umount /mnt/c Then remount the drive including the meta data. sudo mount -t drvfs C:/mnt/c -o metadata Now set permissions on the repository. chmod -R 755 /home/user/Production-Infrastructures Please refer to the following blog for more details about WSL and DrvFS: https://blogs.msdn.microsoft.com/commandline/2018/01/12/chmod-chown-wsl-improvements/ Ansible playbooks can now be executed from the Windows 10 machine. Ansible 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 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.