Description:
Ansible is de facto automation standard in heterogenous server/network environment. Although its roots are from server environment where control host can automate tasks on other servers, it can be also used in network and cloud environment as well. This is due to number of modules for different devices ( e.g. cisco ios, cisco xr, cisco aci..) or virtualization/cloud ( eg. virt, openstack ,…).
In this course, students will first learn how ansible works in its “native” server environment. Basics, such as inventory, playbooks, modules, variables, flow control etc., are described. Next, network automation is described and its specifics ( e.g., automation from source host instead from destination as in server environment, jumphost configuration etc). Next, virtualization and cloud automation is described using virt (libvirt) and os_ (openstack) modules. Finally, AWX platform ( opensource Ansible Tower variant) is explained. Although ansible scripts can be invoked from any host, this is not acceptable for production. Invocation and status logs, user authorization to execute particular job or just see results and other production necessary stuff like notification in case of job failure are available via AWX (or commercial Tower) as deployment platform.

Duration: 5 days

Required knowledge:
This course requires some basic knowledge in different areas: linux basics ( sudo, ssh, scp, file operations… ), network basics ( ios: concepts of running /startup, basic configs like hotstname, acl …) , libvirt and openstack basics. However, as it is expected that some of students work in network and other in server environment, during the course necessary info will be presented. Some basic knowledge in any programming  language is expected but ansible usage does NOT require any advanced programming knowledge e.g. object oriented programming.

Content:

Intro
– about Ansible and its concepts
– control vs controlled hosts
– requirements
– editors with yaml and ansible support: vs code

Ansible operation
– yaml syntax
– ad-hoc operation, inventory; examples
– playbooks, tasks, modules; examples
– variables: declaring, using, registering , debugging; examples
– basic modules and usage: debug, hostname, command , shell, file; examples
– facts
– flow control: conditional statements, loops; examples
– files and templates: creating and using, jinja2 syntax
– modules: copy, template, lineinfile, inifile; examples
– encrypting content: vault; examples
– handlers; examples
– roles; examples

Ansible in server automation
– basic usage: some examples: modules: apt, service

Ansible in networking automation
– modules: ios_*: automation of network provisioning using ansible
– jumphost configuration
– examples: configuring acl, loopback interfaces on cisco ios
– modules: iosxr_*: automation of network provisioning using ansible
– other network modules

Ansible in Openstack and virtualization automation
– modules: os_* : automating openstack using ansible
– examples: creating & destroying servers, networks, images
– modules: virt: automating libvirt using ansible

Ansible deployment platform
– AWX/Ansible Tower: deploying ansible scripts (ad-hoc, playbooks, roles) using AWX – upstream project for Ansible Tower, a commercial derivative of AWX
– product basics
– creating and using inventory, tepmlate, credential
– running and scheduling job
– notifications
– examining output of previous jobs
– limiting access: creating projects, users, asigning user role to the project
– other features