Description
In this course, you will learn :
- In Getting Started with Ansible, you will learn the fundamentals of using Ansible to configure almost anything quickly and reliably.
- How to install Ansible and use the ansible Ad-hoc command line tool to run one-time modules in Ansible to configure single aspects of a system, such as ensuring that a line exists in a file or that an application is installed. Playbooks will be made up of modules that will be stored in simple file(s) that will be processed by ansible-playbook.
- How to use inventories to configure multiple machines, including a full-fledged VM learning lab, which you can then configure using Ansible.
- How to learn what you need to know when you need it.
- How to use connection plugins to connect to different environments, such as Windows machines and Docker containers, instead of Ansible's default use of SSH. And how the ansible-pull command inverts Ansible's default push model.
- Reuse can be discovered using Ansible Galaxy and the corresponding ansible-galaxy command via both Roles and Collections.
- By the end of this course, you should be able to go beyond manually configuring applications, servers, networks, and so on. Aside from writing perplexing scripts. to devote your time to more worthwhile endeavours
Syllabus :
1. Ad Hoc Configuration with Idempotent Modules
- Configuring an Explosion of Devices
- Using the git config Command to Manually Configure User Name and Email
- A Repeatable Script to Automatically Configure Git with user.name and user.email
- git config --add Is Not Idempotent Because It Duplicates Config
- Desired State Reconciliation and the Power of Ansible
- Installing Ansible and the Installation Guide Docs
- Updating Ansible via pip or Otherwise
- Leverage the Porting Guides
- Know How to Know What You Need to Know as You Go
- Why Installs and Even Updates Are Easy - Control Node Architecture
- The Ansible Ad-hoc Command
- Disseminating a .gitconfig with Ansible Ad-hoc and the Copy Module
- Understanding Idempotence with the Copy Module
- How Ansible's Copy Module Handles Drift Thanks to Idempotence
- The --check Flag Simply Checks if Changes Would Be Made
- The --diff Flag Shows What Will Change or Did Change
2. Declaring Desired State with Playbooks
- Ansible Is a Framework for Idempotent Commands
- How About Just Scripting Multiple Ad-hoc Calls!
- Morphing Ad-hoc Calls or Scripted Ad-hoc Calls into Ansible Playbooks
- docker Is to docker-compose What ansible Is to ansible-playbook
- What a Script of Ad-hoc Ansible Calls Looks Like
- Writing a First Playbook to Ensure Our .gitconfig Is Setup
- Running ansible-playbook for the First Time
- Testing ansible-playbook by Removing and Restoring Our .gitconfig
- Increasing ansible-playbook Output Verbosity
- I Cannot Emphasize Enough the Value of Versioning Playbooks with Git
- Adding a Second Play with Two Tasks
- What Happens When We Have a Syntax Error in a Playbook
3. Configuring Multiple Hosts
- What Is Inventory?
- Creating Test VMs with Vagrant
- Perusing My Inventory Directory Example and a Bit About ansible-config list and INVENTORY_IGNORE_EXTS
- VMs Are Operational with No Git Configuration
- Groups and Hosts and Ansible Ad-hoc with Multiple Hosts
- Walking through the Playbook We Will Run against All VM Hosts
- Running Our Playbook against Multiple VMs to Install and Configure Git
- Destroying and Recreating Is Scalable and Reproducible
- Configuring Ansible with ansible.cfg
- Summarizing Inventory with ansible-inventory --graph and with --vars
- Drilling into How Inventory Can Be Represented including with Static INI Files and Inventory Scripts
- Troubleshooting Inventory Scripts by Running Them Independently before Plugging Them into Ansible
- Ansible Uses Inventory Plugins to Provide Inventory in Any Number of Formats including Static and Dynamic
4. Productively Learning and Using Ansible
- Learn Just What You Need to Be Productive
- ansible-doc --help Is a Launching Point for Learning
- Perusing Ansible's Source Code to Learn About Ansible and Discovering the git_config Module
- Finding Nuanced Examples Specific to Your Use Case
- Using Our Newfound git_config Module
- Learning from Extending Your IDE
- I Can Not Emphasize the Value of Command Line Completion
- The Ansible Console REPL
- Don't Feel Bad About Evolving Your Usage and Understanding of Ansible
5. Alternatives to SSH for Connecting to Hosts
- Perusing the Connection Plugins
- Visualizing Connection Plugins, Specifically the Docker Connection Plugin
- ansible-doc -t connection docker
- Creating Three Background Containers with a Playbook
- Using ansible-console to Quickly Inspect Our Newly Created Containers
- Configuring git in Our Three Containers
- Force Killing and Destroying Our Containers at Mock Speed with state=absent and force_kill=yes docker_container Module Parameters
- Making and Testing a Hypothesis About Ansible Using docker container exec
- ansible-pull Is yet Another Connection Approach
6. Exploiting Roles and Collections with ansible-galaxy
- Roles and Collections Are High Level Compositions of Low Level Blocks
- galaxy.ansible.com
- Finding Content on Ansible Galaxy
- First Look at the ansible-galaxy Command and its Role and Collection Actions
- Listing Installed Roles and an Aside to Learn About keep_remote_files
- ansible-galaxy's role install and remove Actions
- Installing a Role and Finding Role Docs Online
- Know What a Role Does before Using It for Security's Sake and, to Know What It Will Do
- Exploiting Containers to Quickly Test Past ansible-galaxy Versions
- Safety Meets Sanity: Testing a Role in an Isolated, Freshly Created Container