Automating Infrastructure with Cisco

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the definition of automation, according to this content?

Automation is using code to configure, deploy, and manage applications together with the compute, storage, and network infrastructures and services on which they run.

Which of the following are common tools used for automation with Cisco infrastructure? (Select all that apply.)

  • Ansible (correct)
  • Chef (correct)
  • Python
  • Puppet (correct)

What are the three stages in the walk-run-fly progression of network automation?

Walk: Read only automation, Run: Activate policies and provide self-service across multiple domains, Fly: Deploy applications, network configurations, and more through CI/CD

One disadvantage of manual operations is that they are prone to human error.

<p>True (A)</p> Signup and view all the answers

What are the three key events that shaped the evolution of the DevOps discipline?

<p>Site Reliability Engineering (SRE), Debois and Agile Infrastructure, Allspaw and Hammond</p> Signup and view all the answers

What are three core principles of the DevOps/SRE culture?

<p>A focus on automation, the idea that &quot;failure is normal&quot;, A reframing of &quot;availability&quot; in terms of what a business can tolerate</p> Signup and view all the answers

What are the two linked ideas that underpin the DevOps/SRE culture?

<p>DevOps must deliver measurable, agreed upon business value and the statistical reality of doing so perfectly is impossible.</p> Signup and view all the answers

What is the definition of idempotency in the context of automation?

<p>An Idempotent software produces the same desirable result each time that it is run.</p> Signup and view all the answers

What is the primary function of a declarative in infrastructure management?

<p>A declarative is a static model and is used by middleware that incorporates deployment-specific details, examines present circumstances, and brings real infrastructure into alignment with the model, and usually least time consuming path.</p> Signup and view all the answers

What does provisioning in the context of automation refer to?

<p>This refers to obtaining compute, storage, and network infrastructure (real or virtual), enabling communications, putting it into service, and making it ready for use by operators and developers.</p> Signup and view all the answers

Which of the following are benefits offered by automation tools compared to ad-hoc scripting? (Select all that apply.)

<p>Handle Scale (A), Facilitate Reusability (B), Engage Community (C), Simplify and Standardize (D), Perform Discovery (E), Promote Security (F)</p> Signup and view all the answers

The unit test framework is useful in test-driven development (TDD) environments.

<p>True (A)</p> Signup and view all the answers

What are the two main components of a typical GitOps setup?

<p>A repository with several branches, a deployment server.</p> Signup and view all the answers

What is the defining characteristic of a blue/green deployment?

<p>It is required to maintain two identical production environments.</p> Signup and view all the answers

What is the main benefit of using network simulation?

<p>Network simulation provides a means to test network configurations, debug configuration code, and to work with and learn Cisco infrastructure and APIs in a safe, convenient, and non-cost-prohibitive way.</p> Signup and view all the answers

VIRL can only be run on bare metal.

<p>False (B)</p> Signup and view all the answers

What is the name of the native configuration format used by VIRL?

<p>.virl file</p> Signup and view all the answers

The .virl file provides a method for determining if configuration drift has occurred on the simulation.

<p>True (A)</p> Signup and view all the answers

Immutability refers to maintaining systems entirely as code, performing no manual operations on them at all.

<p>True (A)</p> Signup and view all the answers

What are the primary benefits of pyATS?

<p>pyATS framework and libraries can be leveraged within any Python code, It is modular and includes components such as AEtest and Easypy, A CLI enables rapid interrogation of live networks, extraction of facts, and helps automate running of test scripts and other forensics, pyATS provides an enormous interface library to Cisco and other infrastructure via a range of interfaces, pyATS can consume, parse, and implement topologies described in JSON, as YANG models, and from other sources, pyATS can also be  integrated with automation tools for building, provisioning, and teardown.</p> Signup and view all the answers

What are the two main components of pyATS?

<p>pyATS framework and libraries, Genie</p> Signup and view all the answers

A Python virtual environment (venv) is a separate isolated environment that prevents changes from affecting the main system.

<p>True (A)</p> Signup and view all the answers

Virtual environments exist only in memory and do not have physical representations on the filesystem.

<p>False (B)</p> Signup and view all the answers

Ubuntu 18.04 always has the python3-venv package preinstalled.

<p>False (B)</p> Signup and view all the answers

What is the key benefit of using a testbed file in pyATS?

<p>The testbed file is an essential input to the rest of pyATS library and ecosystem as it provides information to the framework for loading the right set of library APIs for each device, and how to effectively communicate to them.</p> Signup and view all the answers

The pyATS test declaration syntax is inspired by Python unit-testing frameworks like pytest.

<p>True (A)</p> Signup and view all the answers

What is the primary function of the Genie library in pyATS?

<p>Genie is the pyATS higher-level library system that provides APIs for interacting with devices, and a powerful CLI for topology and device management and interrogation.</p> Signup and view all the answers

What are the key benefits of using Ansible?

<p>Available as open source, and in a version with added features, from IBM/Red Hat, called Ansible Tower, Substantially managed from the Bash command line, with automation code developed and maintained using any standard text editor.</p> Signup and view all the answers

What is the primary method for managing Ansible?

<p>The Bash command line</p> Signup and view all the answers

What are two key features of Ansible's architecture?

<p>It runs on any Linux machine running Python 2 or 3, It connects to managed resources over SSH and enables Ansible to run shell commands on a remote server, Inject Python scripts into targets and remove them after they run, Install Python on target machines if required.</p> Signup and view all the answers

How are tasks organized in Ansible?

<p>Ansible code structure, Work is separated into YAML (<code>.yml</code>) files that contain a sequence of tasks, executed in top-down order, Ansible has hundreds of pre-built Python modules that wrap operating-system-level functions and meta functions, Playbooks and roles, An Ansible playbook can be written as a monolithic document with a series of modular, named tasks, Developers build a model of a complex DevOps task out of low-level playbook task sequences called roles and then reference these in higher-level playbooks, sometimes adding additional tasks at the playbook level, This segregation of concerns ensures clarity, reusability and shareability of roles.</p> Signup and view all the answers

Ansible projects are typically organized in a flat directory structure, without any nested folders.

<p>False (B)</p> Signup and view all the answers

What are the two control-plane solutions available for managing Ansible at scale?

<p>Red Hat Ansible Tower and AWX project</p> Signup and view all the answers

What is the purpose of Ansible Vault?

<p>It enables the encryption of passwords and other sensitive information.</p> Signup and view all the answers

What is the primary purpose of Ansible modules?

<p>Automating Cisco compute and network hardware.</p> Signup and view all the answers

What is the primary method used by Ansible to connect to remote hosts and execute commands?

<p>SSH</p> Signup and view all the answers

What is the name of the file used to define the top-level playbook in Ansible?

<p>site.yml</p> Signup and view all the answers

What is the name of the directory that contains the Ansible role's task definitions?

<p>tasks directory</p> Signup and view all the answers

What is the name of the command used to run an Ansible playbook?

<p>ansible-playbook</p> Signup and view all the answers

What is the purpose of the -i argument in the ansible-playbook command?

<p>It names the inventory file.</p> Signup and view all the answers

What is the primary purpose of the index.html file in the Ansible example?

<p>To create a simple website on a remote host.</p> Signup and view all the answers

What are the two primary ways that Puppet is offered?

<p>Open source, Puppet Enterprise.</p> Signup and view all the answers

What is the recommended approach for installing the Puppet Server?

<p>A monolithic installation.</p> Signup and view all the answers

How does Puppet handle scaling beyond a single server?

<p>Create additional &quot;compile masters&quot; and place them behind a load balancer.</p> Signup and view all the answers

What is the name of the file that is used to configure the Puppet agent's communication with the Puppet Server?

<p>puppet.conf</p> Signup and view all the answers

What is the name of the directory used to store Puppet's configuration files?

<p>/etc/puppetlabs/code/environments</p> Signup and view all the answers

What is the purpose of the "modules" subdirectory in the Puppet environment?

<p>To store subsidiary projects and manifests for things we need to build and configure.</p> Signup and view all the answers

What is the name of the command used to install the Puppet agent on a Debian-based Linux system?

<p>sudo apt-get install puppet-agent</p> Signup and view all the answers

What is the name of the file that is modified to configure the Puppet agent's communication with the Puppet server?

<p>puppet.conf</p> Signup and view all the answers

What is the name of the command used to start the Puppet service on the client?

<p>sudo /opt/puppetlabs/bin/puppet resource service puppet ensure=running enable=true</p> Signup and view all the answers

What is the name of the command used to list pending certificates on the Puppet Server?

<p>ca list</p> Signup and view all the answers

What is the name of the command used to sign a certificate on the Puppet Server?

<p>sudo /opt/puppetlabs/bin/puppetserver ca sign --certname puppetclient</p> Signup and view all the answers

What is the name of the file that is created to store the Puppet agent's configuration on a host?

<p>puppet.conf</p> Signup and view all the answers

What is the primary purpose of the "modules" subdirectory in the Puppet environment?

<p>To store subsidiary projects and manifests for things we need to build and configure</p> Signup and view all the answers

What is the name of the command used to restart the Puppet Server?

<p>systemctl restart puppetserver.service</p> Signup and view all the answers

What are the two primary ways to deploy configuration changes in Puppet?

<p>Restarting the Puppet Server, invoking Puppet agent on a target machine.</p> Signup and view all the answers

What are the two primary products offered by Chef?

<p>Chef Workstation, Chef Infra Server</p> Signup and view all the answers

Chef products are entirely open source, with no licensing restrictions.

<p>False (B)</p> Signup and view all the answers

What are the three main components of the Chef architecture?

<p>Chef Workstation, Chef Infra Client, Chef Infra Server</p> Signup and view all the answers

What is the name of the command used to make configuration changes with Chef?

<p>chef-run</p> Signup and view all the answers

What package is installed in the initial Chef configuration exercise?

<p>ntp package</p> Signup and view all the answers

What is the name of the utility used to preinstall Chef Infra Client on a target node?

<p>Omnitruck</p> Signup and view all the answers

What two packages or services need to be installed before installing Chef Infra Server?

<p>openssh-server, NTP</p> Signup and view all the answers

What command is used to turn off the default timedatectl synchronization service on an Ubuntu system?

<p>sudo timedatectl set-ntp 0</p> Signup and view all the answers

What is the command used to initialize and start all services after installing Chef Infra Server?

<p>sudo chef-server-ctl reconfigure</p> Signup and view all the answers

What is the name of the command used to install the Chef Manage web interface?

<p>sudo chef-server-ctl install chef-manage</p> Signup and view all the answers

How are keys retrieved and stored during the Chef configuration process?

<p>Keys are stored in the <code>.chef</code> folder after Server configuration, and keys are retrieved from the Server and stored in the <code>.chef</code> folder after Workstation installation.</p> Signup and view all the answers

What is the primary function of Knife in Chef?

<p>Knife is a tool for managing cookbooks, recipes, nodes, and other assets, and for interacting with the Chef Infra Server.</p> Signup and view all the answers

What file is edited in the .chef folder and contains configuration settings forKnife?

<p>config.rb</p> Signup and view all the answers

What is the purpose of the knife ssl fetch command?

<p>It retrieves the Chef server's certificate and stores it in the .chef directory.</p> Signup and view all the answers

What is the name of the command used to bootstrap a target node using Knife?

<p>knife bootstrap</p> Signup and view all the answers

What are the two primary functionalities of the recipe[apache2] expression in Chef?

<p>Install the Apache2 web server and copy the index.html file to the target server.</p> Signup and view all the answers

What is the name of the command used to execute a Chef client application from a remote host using Knife?

<p>knife ssh chef-client</p> Signup and view all the answers

Flashcards

What is infrastructure automation?

The use of code to configure, deploy, and manage applications along with the compute, storage, and network infrastructure they run on.

How does Cisco infrastructure support automation?

Cisco infrastructure can integrate with common tools like Ansible, Puppet, and Chef, or provide direct API access for automation.

What are the stages of Cisco network automation?

Automation solutions for the network can be categorized into three stages: Walk, Run, and Fly, each with increasing complexity and capabilities.

What is the 'Walk' stage of network automation?

The 'Walk' stage involves read-only automation using tools to collect information about network configurations.

Signup and view all the flashcards

What is the 'Run' stage of network automation?

The 'Run' stage enables users to activate policies and provide self-service across multiple domains, allowing safe provisioning of network updates.

Signup and view all the flashcards

What is the 'Fly' stage of network automation?

The 'Fly' stage allows for complex automation and programmability using tools like the DevNet Automation Exchange to deploy applications, configure networks, and manage operations through CI/CD.

Signup and view all the flashcards

Why is automation important in terms of speed and agility?

Automation improves speed and agility, enabling businesses to explore and seize opportunities faster than their competitors.

Signup and view all the flashcards

How does automation benefit developers?

Developers need to accelerate every phase of software development, including coding, iteration, testing, and staging.

Signup and view all the flashcards

What role does automation play in DevOps?

DevOps practices require developers to deploy and manage applications in production, making automation essential for those activities.

Signup and view all the flashcards

What are the disadvantages of manual operations?

Manual operations can be costly, time-consuming, and difficult to scale. They are also prone to human errors and inconsistent documentation.

Signup and view all the flashcards

What are the challenges of dependency risks?

The decentralized nature of today's software ecosystem creates dependencies that can cause disruptions and security risks.

Signup and view all the flashcards

What is required for interoperability in a decentralized software ecosystem?

Components need to function independently and seamlessly with other components across various situations, without relying solely on specific architectures.

Signup and view all the flashcards

What are the risks associated with discontinued support?

Developers might abandon support for old features or rarely-used integrations, disrupting processes that depend on these features.

Signup and view all the flashcards

How do dependency risks affect deployments?

Heavy reliance on dependencies can lead to inflexible and insecure deployment stacks, making it challenging to update and maintain.

Signup and view all the flashcards

What are the benefits of full-stack automation?

Full-stack automation encompasses managing all aspects of application development, deployment, infrastructure provisioning, and ongoing operations, leading to self-service, scalable infrastructure, observability, and automated problem mitigation.

Signup and view all the flashcards

How does full-stack automation enable self-service?

Full-stack automation empowers users to request infrastructure resources on demand, facilitating faster deployment and resource allocation.

Signup and view all the flashcards

How does full-stack automation support scalability?

Full-stack automation allows applications and platforms to dynamically scale up or down in response to workload demands, ensuring optimal resource utilization.

Signup and view all the flashcards

How does full-stack automation enhance observability?

Full-stack automation provides tools and techniques for monitoring and understanding the internal state of a complex system, facilitating troubleshooting and performance analysis.

Signup and view all the flashcards

How does full-stack automation enable automated problem mitigation?

Full-stack automation incorporates mechanisms for automatically mitigating issues, repairing problems, and monitoring events, ensuring continuous system operation.

Signup and view all the flashcards

What is software-defined infrastructure?

Software-defined infrastructure, also known as cloud computing, enables developers and operators to utilize software to provision, configure, deploy, and manage both physical and virtualized resources.

Signup and view all the flashcards

What are the benefits of cloud computing?

Cloud computing paradigms offer benefits such as self-service, consistency, repeatability, and platform abstraction, simplifying resource management.

Signup and view all the flashcards

What are the challenges of working with cloud paradigms?

Developers must carefully consider platform design, architecture, and security when working with cloud environments, as misconfigurations can have significant consequences.

Signup and view all the flashcards

Why is access control important in cloud environments?

Access control in cloud environments is vital to prevent unauthorized access and misuse of resources, safeguarding organizational assets.

Signup and view all the flashcards

How can self-service in cloud environments lead to cost management challenges?

The ease of provisioning cloud resources through manual methods can lead to uncontrolled consumption and difficulties in managing costs.

Signup and view all the flashcards

What is a distributed application?

Modern application architectures are increasingly distributed, comprising smaller, interconnected components often referred to as microservices.

Signup and view all the flashcards

How are microservices implemented?

Microservices are typically isolated in containers, communicate through discovery and messaging services, and are often backed by resilient, scalable databases.

Signup and view all the flashcards

What are the benefits of microservices?

Microservices offer advantages such as scalability, eliminating single points of failure, and leveraging infrastructure automation tools for on-demand scaling and self-healing, improving application resilience.

Signup and view all the flashcards

What are the challenges of managing microservices?

The dynamic nature of microservices, while offering benefits, can also lead to increased complexity in deploying and managing these complex components.

Signup and view all the flashcards

Why is automation crucial for microservice-based applications?

Automation is essential for managing microservice-based applications due to their dynamic nature and the need to handle on-demand scaling, self-healing, and other complex operations.

Signup and view all the flashcards

What tasks are involved in automating infrastructure?

Automation tools are essential for managing all phases of application development, including configuration, deployment, lifecycle management, and integration with software-defined infrastructures.

Signup and view all the flashcards

How does automation impact code management?

Automation is becoming increasingly important for managing the code used to develop, test, stage, monitor, and operate applications at scale, streamlining the entire infrastructure lifecycle.

Signup and view all the flashcards

How does full-stack automation impact organizational culture.

Full-stack automation requires a change in organizational culture, breaking down the historical divide between development (Dev) and operations (Ops), leading to a more collaborative environment.

Signup and view all the flashcards

Study Notes

Automating Infrastructure with Cisco

  • Automation uses code to configure, deploy, and manage applications and their supporting infrastructure (compute, storage, and network)
  • Cisco infrastructure platforms integrate with common tools like Ansible, Puppet, and Chef, or offer direct API access to programmable infrastructure.
  • Several automation use cases exist, depending on the operational model to be followed. These include "walk" (read-only automation), "run" (activating policies and self-service), and "fly" (deploying applications and handling more complex scenarios via CI/CD)

Why Do We Need Automation?

  • Speed and agility enable businesses to explore, experiment, and exploit market opportunities more quickly.
  • Developers need to accelerate software building phases (coding, testing, staging).
  • DevOps practices require developers to deploy and manage applications in production, so automation is necessary.
  • Manual operations are costly, time consuming, prone to human error, and often incomplete or ambiguous.

Dependency Risks

  • Today's software ecosystem is decentralized. Developers often build individual components according to their needs, mixing and matching components.
  • Components need to work together with many other components.
  • Component developers may abandon support for obsolete features. This disrupts processes.
  • Dependency-ridden application setups often become locked into fragile and insecure deployment stacks.

Why do we need Full-Stack automation?

  • Self-service: Automation offers self-service for infrastructure on-demand.
  • Scalability on demand: Applications and platforms can scale up or down based on workload demands.
  • Observability: Allows users to observe the internal state of complex systems from outputs.
  • Automated problem mitigation: Enables applications and platforms to self-heal and decrease the effects of issues, preventing downtime.

Software-Defined Infrastructure: A Case for Automation

  • Software-defined infrastructure (often cloud-based) allows developers and operators to use software to manage bare-metal and virtualized resources.
  • Benefits of cloud paradigms include self-service, detailed specifications, consistency and repeatability, and platform abstraction.
  • Challenges in cloud paradigms include ensuring secure developer access control and calculating precise costs.

Distributed and Dynamic Applications: Another Case for Automation

  • Modern application architectures are increasingly distributed.
  • They consist of small, light components (microservices).
  • Components are isolated in containers, communicated via discovery and messaging services.
  • They are backed by resilient, scalable databases.

Benefits of Microservices

  • Scalability: Microservices can be scaled and load-balanced as needed across numerous servers or regions.
  • Infrastructure automation: Tools automate on-demand scaling, self-healing, and more with microservice-based applications.

Challenges of Microservices

  • Increased complexity: Management and deployment of numerous moving parts.
  • Automation is a requirement: Manual methods are not effective for managing complex deployments.

Automating Infrastructure Summary

  • Automation is necessary for managing all phases of application development (app building, configuration, deployment, and lifecycle management).
  • Tools automate management of software-defined infrastructure on behalf of applications
  • Automation code is treated as a single work product.

DevOps and SRE

  • Full-stack automation requires organizational cultural shifts to eliminate historical divides between Development (Dev) and Operations (Ops).
  • Traditionally, creating apps fell under the Dev remit while maintaining the apps was under Ops.
  • Dev and Ops differences include resource management, responsibilities, and priorities.

Evolution of DevOps

  • Key moments include the institutionalization of Site Reliability Engineering (SRE) at Google, Patrick Debois' work of automating virtual and physical resources using version control and agile methods, and John Allspaw and Paul Hammond's presentation of DevOps best practices.

Core Principles of DevOps

  • Focus on automation
  • The idea of failure as normal
  • The reframing of availability - how much error/downtime can be tolerated

SLOs, SLIs and Error Budgets

  • DevOps/SRE cultures demand deliverable, measurable, agreed upon business value.
  • Defining metrics in terms of real Service Level Indicators (SLIs).
  • SLOs help deliver business values more rapidly.
  • Error budgets guide development- and operational tasks.

DevOps and SRE Summary

  • DevOps/SRE is evolving alongside virtualization, containerization, and unified toolsets for application and infrastructure engineering.

Basic Automation Scripting

  • Powerful automation tools simplify, ease, and increase predictability for DevOps tasks.
  • Automation tools like Ansible, Puppet, and Chef wrap shell functionality, operating system utilities, and other control plane elements to achieve operational goals of simplicity, uniformity, and enrichment.
  • Basic automation scripting is essential.

Basic Tools for Automation Scripting

  • Shells (e.g., Bash) are ubiquitous and the foundation for much automation.
    • Commands are similar to command lines, useful to script AWS CLI access.
    • High-level languages make scripting more complex, parallel operations, and error handling easier.
  • Programming languages beyond Bash handle complexity and scale requirements well.
    • Useful for controlling actions in virtualized cloud environments.

Procedural Automation

  • An ordered sequence of commands to achieve a goal.
  • Instructions may include flow control, conditions, functions, classes.
  • To improve efficiency, standardize ordering with parameters, flags, and errors.
  • Dividing tasks creates modular, reusable, configurable code in scripts.
  • Separating deployment-specific data from code makes code generic and reusable.

Executing Scripts Locally and Remotely

  • Automate with shell utilities or copy/transmit scripts.
  • Pipe commands to remote machines for execution.

Cloud Automation

  • Cloud providers often offer specialized tools for managing cloud resources.
  • Popular deployment tools extract resource inventories from cloud frameworks during automation.

Cloud CLIs and SDKs

  • Cloud Infrastructure as a Service (IaaS) and other infrastructure clouds often provide CLIs and SDKs for easy connectivity.
  • REST-based interfaces are common. (Cisco UCS - a bare metal cloud, VMware, and OpenStack each have toolkits/APIs of their own.)

Ansible

  • Ansible is an open-source automation tool.
  • Ansible is commonly managed via the Bash command line with automation code from standard text editors.
  • Ansible's architecture is simple and lightweight.
    • Control node runs Python (2 or 3).
    • SSH-based connection.
    • Executes shell and python commands/scripts on remote hosts.
    • Enables installing Python on target machines.

Ansible (Contd.)

  • Ansible code structures use YAML files (with code) describing task sequences run in (top-down order).
  • Playbooks and roles enable modular organization for tasks into maintainable units.

Ansible (Contd.)

  • Ansible projects are organized in a nested directory structure for version control or GitOps-style infrastructure as code.
  • Scaling challenges for larger organizations can be addressed by centralized solutions (Red Hat Ansible Tower; AWX project)
  • Ansible Vault enables encryption of sensitive information.

Cisco Ansible Resources

  • Extensive libraries of Ansible modules for automating many different Cisco products.
  • Automate configurations on Cisco Application-Centric Infrastructure (ACI) enabled devices (using APIC).
  • Automate device configurations with IOS-XR and NETCONF/REST interface support.
  • Automate Cisco UCS configurations via Intersight REST interface.

Ansible Example

  • Ansible uses SSH to connect and execute commands (on remote hosts).

Ansible Example (Setup)

  • Preparing project directory and files.
    • Create folders for roles, and create a site.yaml inventory file, and main.yaml playbook.

Ansible Example (running)

  • Run commands using Ansible.
  • Check for success and failures of deployment.

Ansible Example (Contd.)

  • Create an index.html file with a basic website, save the changes.
  • Execute Ansible playbook and note the changes on the remote target.

Ansible Example (CI/CD)

  • Simulating CI/CD pipeline: a step for developers, tests, and moving changes to Production (ansible-playbook -vv).

Lab — Use Ansible to Backup and Configure a Device

  • Instructions to launch VMs, configure Ansible, back up configurations, and configure devices.

Lab — Use Ansible to Automate Installing a Web Server

  • Instructions to automate web server installations.

Puppet

  • Puppet was introduced in 2005 as open source and later commercialized.
  • Puppet uses a server and clients.
  • Components include a server to hold main components, a secure client(Puppet Agent), and modules that support connections and hardware.
  • A proxy agent offloads connection tasks (to handle large-scale deployments).

Puppet (Installing the Server)

  • Puppet server needs powerful hardware (or a Virtual Machine.)
  • It requires network time protocol (NTP).
  • The Puppet puppet.conf file configures communication.
  • The client will receive a signed certificate.

Puppet Code Structure

  • Puppet components are structured into a tree folder.
  • Additional resources can be downloaded/installed from Puppet Forge (by using a command).

Puppet at Scale

  • A monolithic installation is recommended.
  • Additional compile masters provide compilation for larger numbers of client agents and place them behind a load balancer to distribute work.
  • Enterprise customers use PE-PostgreSQL for a stand-alone instance of PuppetDB to further improve capacity.

Cisco Puppet Resources

  • Extensive libraries of Puppet modules for automating Cisco compute and network hardware, including modules for IOS infrastructure, and UCS management via Cisco UCS Manager.

Puppet Example

  • Describes how to install Puppet and configure Apache2 remotely on a target device.
  • Includes how to install the Puppet agent, run commands and establish the certificate (needed for the agent to communicate).

Puppet Example (Config)

  • Configuring puppet.conf to define the Server, authentication certificates, the locations of code.

Puppet Example (Client Installation)

  • Installing Puppet agent (a client) on the target machine.

Puppet Example (Starting Puppet Service)

  • This will initiate Puppet's service on the target machine.

Puppet Example (Certificate)

  • This stage will verify that the certificate has been signed and that communication is possible between the server and the target machine.

Puppet Example (Creating Configuration)

  • This stage describes how to create the necessary files to configure the target machine.

Puppet Example (Deploying Configuration)

  • This stage describes how to apply the configuration to the target machine via the server.
    • systemctl restart puppetserver.service (used for deploying the configuration.)

Chef

  • Chef is a complete system for treating infrastructure as code.
  • Features include infra-as-code creation, testing, organization, and repository storage.
  • Execution on remote targets from a stand-alone Chef Workstation or a central server.

Chef Architecture Components

  • Chef Workstation (a host agent).
  • Chef Infra Client.
  • Chef Infra Server.

Chef Installation on a Workstation

  • Install Chef Workstation on a Linux based VM or Ubuntu.

Chef Example to Install and Use Chef

  • Install necessary software. (NTP and OpenSSH)
  • Use commands such as chef-run to deploy configurations.

Chef Infra Server Prerequisites

  • Install openssh-server and enable keywise access.
  • Install NTP for time synchronization.

Chef Example: Installing Chef Server

  • Install via commands, obtain the .deb package and install it using dpkg -i.
  • Initialize and configure the server sudo chef-server-ctl reconfigure

Chef Example: Starting and Enabling Chef-Manage

  • Run sudo chef-server-ctl install chef-manage command.

Chef Example: Configuring a Workstation

  • Retrieve keys, put them in a folder, like /home/username/.chef (using the scp command).

Chef Example: Prepare to use Knife

  • Create a config.rb file in the .chef folder.

Chef Example: Bootstrap a target node

  • Using Knife to bootstrap a target node with parameters such as <name-for-your-node>

Chef Example: Verify Knife Success

  • Verify successful installation.

Chef Example: Putting It All Together

  • Example to demonstrate an end to end setup including creating a cookbook, configuring files, deploying the configuration using Chef.

Network Simulation and VIRL

  • VIRL is a powerful tool for network simulation.
  • It allows users to test configuration, troubleshoot bugs in configuration code.
  • It supports various topologies, including a two router IOS network.

VIRL Files

  • The virl files describe a simulation's components (routers, configurations, connections) in a YAML format.
  • These files can be used for managing and configuring simulations in various software platforms.

Infrastructure as Code

  • The approach to maintain systems by treating configuration as code.
  • GitOps is a workflow for using Git to manage and automate deployments.
  • Blue/Green deployment is a strategy to reduce downtime in production environments by swapping environments between operational use.

Canary Testing

  • Canary testing provides a method of implementing new code or deployments in a controlled way on a subset of users.

Automating Testing

  • Automated testing is beneficial to identify bugs and failures in applications quicker.
  • PyATS enables code review and testing with unit tests, providing a means to validate and improve network configurations by checking code behavior based on developer commits, or pull requests, in a QA or Production environments.

PyATS Tools

  • Python Automated Test System (pyATS).
    • Provides automated testing and validation capabilities.
  • Genie - a higher-level library in pyATS;
    • Facilitates interaction with various devices using APIs.

pyATS Example

  • Describes how to install pyATS, configure, and use virtual machine environments for testing.
  • It involves creating Virtual Environments, install the python3-venv package.

Lab — Automated Testing using pyATS

  • Describes steps for setting up automated tests.
    • Launch virtual machines (VMs).
    • Setting up the Python Virtual Environment.
    • Using the pyATS Testing Library.
    • Using Genie to compare configurations.

Network Simulation

  • Using VIRL tools to simulate network environments is useful in validating configurations before implementing changes, troubleshooting configurations/code bugs, or just experimenting with different configurations safely.
  • VIRL supports a CLI for managing systems locally, a REST interface for automation integration, and a UI for configuration.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Use Quizgecko on...
Browser
Browser