Terraform & Ansible

Infrastructure as Code & Config Management

Infrastructure as Code (IaC)

Infrastructure as Code allows to automate the process of creating infrastructure – on-premise or cloud resources such as virtual machines, through specifying the desired result as code.

The most popular tool for this purpose is Terraform which allows to specify all infrastructure resources required as code in the HCL declarative language (HashiCorp Configuration Language).

Configuration Management

Configuration Management allows to automate the process of configuring infrastructure, e.g. by installing and configuring software – on-premise physical or virtual machines or cloud resources such as virtual machines, through specifying the desired result as code.

Ansible has become the most popular tool for this purpose, thanks to it’s agentless nature (as long as ssh access to the resources is available, no other agent is required) and the availability of many modules and roles.

Infrastructure as Code – with Terraform

Trainings on the popular Terraform “Infrastructure as Code” tool from HashiCorp are available as introductory trainings and also as preparation for the “Terraform Associate Certification”.

  • “Infrastructure as Code” Technologies
    • Terrform Introduction, 2 days
    • “Terraform Associate Exam” Preparation, 2 days

Terraform is an open source platform-agnostic “Infrastructure as Code” tool from HashiCorp.
With a few simple commands it is possible to stand up or tear down complete infrastructures from simple virtual machines to complete data centers.

Description

This training proposed as a 2-day training, or 4 half-days, introduces students to the advantages of developing “Infrastructure as Code” with Terraform.

Terraform allows to manage the deployment of different infrastructure types via the appropriate “Provider” plugin – this course uses the AWS provider allowing to manage many AWS cloud resources.

Students will appreciate the ease with which infrastructure resources are defined in a declarative manner allowing resources to be created, updated or destroyed in an idempotent manner.

Note: the course can be adapted to other AWS services, or other cloud providers.

Terraform uses HCL v2 – “HashiCorp Configuration Language” – to define resources to be created for 1 or more providers.

Pre-requisites:

  • Be at ease working at the command-line
  • Notions of Amazon Web Services (AWS) such as EC2, S3

Use of an ssh Client, e.g. openssh on Linux, macOS or, WSL, Putty on Windows

Included:

  • Course materials and labs: 50% hands-on, 50% presentation & demos
  • Access to a temporary lab environment

Access to an evolutive document covering various Terraform learning resources

Objectives of the training:

  • Learn to use Terraform for standing up various AWS resources

Know where to find information about other Providers, Modules for Google Cloud, Azure etc …

Course content:

  • Introduction to Infrastructure as Code
    • Infrastructure as Code, Config Management, Idempotence
  • Terraform
    • Installation
    • Terraform Workflow
    • The plan
    • Applying and re-applying plans
    • Destroying resources
    • Various sub-commands
  • HCL Configurations
  • Providers
  • Variables
  • Resources
  • Control Structures
  • Templates
  • Data sources
    • Provider Data Sources
  • State
    • Local State
    • Using “remote state” for working in teams
  • Modules
    • Modules structure
    • Using modules
    • terraform-aws-modules
    • Terraform Registry
    • Writing your own modules
  • Provisioners
    • Local-exec
    • File
    • Remote-exec
  • Importation of foreign resources
    • Importation of resources created outside Terraform
      • terraform import
      • terraforming
  • Auto-scaling & Load-Balancing
    • AWS EC2 ASG – Autoscaling Groups
    • AWS EC2 ALB – Application Load Balancer
  • Other AWs resources
    • Lambda
    • VPC, EIP
    • S3, EBS
    • IAM, RDS
  • Best practices
    • Terraform Best practices
    • Tooling: Linters, scanners, testers
  • HashiCorp Terraform Eco-system
    • Terraform Cloud, Terraform Enterprise
    • CDK, Waypoint, Boundary

Certification

Preparing the “Terraform Associate” Exam

Description

This training covers most of the Terraform Introduction training but with a particular focus on passing the “Terraform Associate” exam

Terraform allows to manage the deployment of different infrastructure types via the appropriate “Provider” plugin – this course uses the AWS provider allowing to manage many AWS cloud resources.

Students will appreciate the ease with which infrastructure resources are defined in a declarative manner allowing resources to be created, updated or destroyed in an idempotent manner.

Note: though the exam is “provider agnostic” – this course can nevertheless be adapted to other AWS services, or other cloud providers.

Note: the exam is comprised entirely of multiple choice questions.

Terraform uses HCL v2 – “HashiCorp Configuration Language” – to define resources to be created for 1 or more providers.

Pre-requisites:

  • Be at ease working at the command-line
  • Notions of Amazon Web Services (AWS) such as EC2, S3

Use of an ssh Client, e.g. openssh on Linux, macOS or, WSL, Putty on Windows

Included:

  • Course materials and labs: 50% hands-on, 50% presentation, demos
  • Exam practice questions
  • Access to a temporary lab environment

Access to an evolutive document covering various Terraform learning resources

Objectives of the training:

  • Learn to use Terraform for standing up various AWS resources

Preparation for the exam

Course content:

  • Introduction to Infrastructure as Code
    • Infrastructure as Code, Config Management, Idempotence
  • Terraform
    • Installation
    • Terraform Workflow
    • The plan
    • Applying and re-applying plans
    • Destroying resources
    • Various sub-commands
  • HCL Configurations
  • Providers
  • Variables
  • Resources
  • Variable types
    • Variables,passing values to the configuration, Locals
  •  
  • Control Structures
  • Templates
  • Data sources
    • Provider Data Sources
  • State
    • Local State
    • Using “remote state” for working in teams
  • Modules
    • Modules structure
    • Using modules
    • terraform-aws-modules
    • Terraform Registry
    • Writing your own modules
  • Provisioners
    • Local-exec
    • File
    • Remote-exec
  • Importation of foreign resources
    • Importation of resources created outside Terraform
      • terraform import
      • terraforming
  • Auto-scaling & Load-Balancing
    • AWS EC2 ASG – Autoscaling Groups
    • AWS EC2 ALB – Application Load Balancer
  • Other AWs resources
    • Lambda
    • VPC, EIP
    • S3, EBS
    • IAM, RDS
  • Best practices
    • Terraform Best practices
    • Tooling: Linters, scanners, testers
  • HashiCorp Terraform Eco-system
    • Terraform Cloud, Terraform Enterprise
    • CDK, Waypoint, Boundary
    • Certification

Terraform & Ansible

Configuration Management – with Ansible

Training on the popular Ansible “Configuration Management” tool from RedHat is available as an introductory 2 day training.

Ansible is an agentless open source platform-agnostic “Configuration Management” tool from RedHat.
Ansible playbooks written in YAML can be applied to a group of physical or virtual hosts to install and configure software in a repeatable reliable fashion. Such configuration is said to be idempotent because running the same playbooks against the hosts will produce the same result – repairing if needed, installing if needed or no action if the current configuration matches the playbook description. With a few simple commands it is possible to configure simple virtual machines or complete data centers.

Description

This training proposed as a 2-day training, or 4 half-days, introduces students to the advantages of developing “configuration management” with Ansible.

Ansible allows to create playbooks to install & configure full software stacks, or to reuse Roles available on the Ansible Galaxy resource.

Students will appreciate the ease with which nodes can be automatically configured with the desired software configuration in an idempotent manner.

Course content:

  • Ansible Overview
    • Why Ansible?
    • Overview of Architecture
    • Inventory
    • Inventory Patterns
    • Inventory Plugins
  • Deploying Ansible
    • Installing
    • Configuration Files
    • Module Syntax Help
    • Running Ad-Hoc Commands
    • Dynamic Inventory
  • Playbooks Basics
    • Writing YAML Files
    • Playbook Structure
    • Host and Task Execution Order
    • Command Modules
    • Significant Module Categories
    • File Manipulation
    • Network Modules
    • Packaging Modules
    • System Storage
    • Account Management
    • Security
    • Services
  • Variables & Inclusions
    • Variables
    • Variables – Playbooks
    • Variables – Inventory
    • Variables – Registered
    • Variables – Magic
    • Facts
    • Inclusions
  • Jinja2 Templates
    • Jinja2
    • The template Module
    • Expressions
    • Filters
    • Methods
    • Tests
    • Lookups
    • Control Structures
  • Task Control
    • Loops
    • Loops & Variables
    • Conditionals
    • Handlers
    • Tags
    • Handling Errors
  • Roles
    • Roles
    • Role Usage Details
    • Creating Roles
    • Deploying Roles with Ansible Galaxy
  • Optimizing Ansible
    • Connection Types
    • Delegation
    • Parallelism
    • Callback Plugins
  • Ansible Vault
    • Configuring Ansible Vault
    • Vault IDs
    • Executing with Ansible Vault
  • Network Automation
    • Network Automation
    • Simple Network Module Examples
    • Network Modules: Gotchas
    • Simple IOS Modules Examples
    • General Purpose ios Modules
    •