0% found this document useful (0 votes)
116 views

OrhanErgun - AnsibleFundamentals

This document provides an overview of Ansible fundamentals for network engineers. It discusses prerequisites for using Ansible, what Ansible is and why it is used. It also covers topics like Ansible use cases, setting up an Ansible lab with VMs, the Ansible engine including host inventory and playbooks. The document provides examples of inventory files in INI and YAML format as well as an example playbook.

Uploaded by

amit_post2000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
116 views

OrhanErgun - AnsibleFundamentals

This document provides an overview of Ansible fundamentals for network engineers. It discusses prerequisites for using Ansible, what Ansible is and why it is used. It also covers topics like Ansible use cases, setting up an Ansible lab with VMs, the Ansible engine including host inventory and playbooks. The document provides examples of inventory files in INI and YAML format as well as an example playbook.

Uploaded by

amit_post2000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Ansible

Fundamentals
for Network Engineers

www.orhanergun.net
- Certs & Skills

www.orhanergun.net
- Ansible Fundamentals Topics
1 Ansible Understanding
• 1.a What is Ansible
• 1.b Why Ansible
• 1.c Ansible Use Cases

2 LAB Setup
• 2.a LAB
• 2.a i LAB Overview
• 2.a ii LAB Setup (Install VMs, Prerequisites and Ansible)
• 2.b Ansible Engine
• 2.b i Host Inventory
• 2.b ii ansible config

3 Starting Automation
• 3.a First PlayBook
www.orhanergun.net
- Prerequisites
• Network (ex. CCNA, CCNP)

• Network Automation overview

• Python beginner

• Virtualization (ex. VMware WorkStation or ESXi)

• Linux Administration

www.orhanergun.net
- What is Ansible
• Started as open-source project, now owned by RedHat.

• An automation engine that automates cloud


provisioning, configuration management, application
deployment, intra-service orchestration, etc.….

www.orhanergun.net
- Why Ansible
• Uses YAML format

• Light weight

• Agentless tool connect with SSH, WinRM, and more ….

• RedHat Provided Ansible Tower (GUI)

• Integrations such as Network, Cloud,


DevOps, and Security.

www.orhanergun.net
- Ansible Use Cases

www.orhanergun.net
- Ansible Use Cases (cont.)

www.orhanergun.net
- Ansible LAB Overview-Setup
Ø PC Specs
• 8 Core
• 16 GB RAM
• 60 GB Storage

Ø Software
• Hypervisor such as VMware Workstation
• Microsoft VS code

Ø VMs
• EVE-NG
• Linux OS such as RHEL

www.orhanergun.net
- Ansible Engine
Ø Inventory
• Store information for target managed nodes
• Contains IP, FQDN, vars, etc…..
• Most common format are INI & YAML

Ø Playbook
• May have single or multiple plays
• Each play defines (target & at least one task)
• Written in YAML supposed to be
human-friendly to read.

www.orhanergun.net
- Inventory INI example
[all:vars]
ansible_connection=network_cli
ansible_user=cisco

[datacenter:children] [routers:vars]
routers ansible_become=yes
switches ansible_become_method=enable
ansible_network_os=cisco.ios.ios
[routers] ansible_user=my_ios_user
172.17.10.1 ansible_password=my_ios_password
172.17.10.2

[switches]
172.17.10.3
172.17.10.4

www.orhanergun.net
- Inventory YAML example
routers: swithces:
hosts: hosts:
R01: SW01:
ansible_host: 172.17.10.1 ansible_host: 172.17.10.3
R02: SW02:
ansible_host: 172.17.10.2 ansible_host: 172.17.10.4

vars: datacenter:
ansible_network_os: cisco.ios.ios children:
ansible_user: my_cisco_user routers:
switches:

www.orhanergun.net
- Playbook example
Ø Play
• List of tasks
• Run linearly by default

Ø Task
• Action
• Could be run with playbook
or ad hoc command

Ø Module
• Code that Ansible execute
• Ex. VLAN interfaces in network device

www.orhanergun.net

You might also like