Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Ansible For Windows By Examples
Ansible For Windows By Examples
Ansible For Windows By Examples
Ebook251 pages1 hour

Ansible For Windows By Examples

Rating: 0 out of 5 stars

()

Read preview

About this ebook

Ansible is a popular open-source IT automation technology for scripting applications in a wide variety of domains.

It is free, portable, powerful, and remarkably easy and fun to use.

This book is a tool to learn the Ansible automation technology with some real-life examples.

Whenever you are new to automation or a professional

LanguageEnglish
PublisherLuca Berton
Release dateApr 19, 2022
ISBN9788090853614
Ansible For Windows By Examples
Author

Berton

Luca Berton is an Ansible Automation Engineer of Red Hat, based in Brno - Czech Republic. With more than 15 years of experience as a System Administrator, he has strong expertise in Infrastructure Hardening and Automation. Enthusiast of the Open Source supports the community sharing his knowledge in different events of public access. Geek by nature, Linux by choice, Fedora of course.

Read more from Berton

Related to Ansible For Windows By Examples

Related ebooks

System Administration For You

View More

Related articles

Reviews for Ansible For Windows By Examples

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Ansible For Windows By Examples - Berton

    Ansible For Windows By Examples

    Ansible For Windows By Examples

    30+ Automation Examples For Windows System Administrator And DevOps

    Luca Berton

    This book is for sale at http://leanpub.com/ansibleforwindowsbyexamples

    This version was published on 2022-04-08

    publisher's logo

    *   *   *   *   *

    This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and many iterations to get reader feedback, pivot until you have the right book and build traction once you do.

    *   *   *   *   *

    © 2022 Luca Berton

    ISBN for EPUB version: 978-80-908536-1-4

    ISBN for MOBI version: 978-80-908536-2-1

    Table of Contents

    Introduction

    Whois Luca Berton

    Ansible For Beginners With Examples

    What is Ansible

    Getting Started

    Inventory

    Playbook

    Variables

    Facts and Magic Variables

    Vault

    Conditional

    Loop

    Handler

    Role

    Ansible Best Practices

    Install Ansible

    Ansible terminology - ansible vs ansible-core packages

    How to install Ansible in Windows 10 WSL Windows Subsystem for Linux - Ansible install

    How to install Ansible in Windows 11 WSL Windows Subsystem for Linux

    How to install Ansible with PIP

    Ansible Playbook Code for Windows

    Configure a Windows Host for Ansible - ansible winrm

    Test Windows host availability - Ansible module win_ping

    Create an empty file in Windows-like systems - Ansible module win_file

    Check if a file exists on Windows-like systems - Ansible module win_stat

    Install Windows software - Ansible module win_chocolatey

    Copy files to Windows remote hosts - Local to Remote - Ansible module win_copy

    Copy files from Windows remote hosts - Ansible module fetch

    Reboot Windows hosts - Ansible module win_reboot

    Install Google Chrome in Windows-like systems - Ansible module win_chocolatey

    Extract an archive in Windows-like systems - Ansible module win_unzip

    Download a file in Windows-like systems - Ansible module win_get_url

    Create a directory on Windows-like systems - Ansible module win_file

    Check if a directory exists on Windows-like systems - Ansible module win_stat

    Check Registry .NET Framework version on Windows-like systems - Ansible module win_reg_stat

    Rolling Update Windows-like systems - Ansible module win_updates

    Add Windows Registry on Windows-like systems - Ansible module win_regedit

    Remove Windows Registry path or key on Windows-like systems - Ansible module win_regedit

    Create a local group on Windows-like systems - Ansible module win_group

    Remove a local group on Windows-like systems - Ansible module win_group

    Create a local user on Windows-like systems - Ansible module win_user

    Change local user password on Windows-like systems - Ansible module win_user

    Backup With Robocopy on Windows - Ansible module win_robocopy

    Ansible modules - win_command vs win_shell

    Ansible Troubleshooting The Most Common Errors

    Ansible troubleshooting - PowerShell incompatible with the sudo become plugin

    Ansible troubleshooting - Windows 10 Error 0x80370102 WSL: Windows Subsystem for Linux

    Ansible troubleshooting - Windows 11 Error 0x80370102 WSL: Windows Subsystem for Linux

    Ansible troubleshooting - module failure on Windows-target

    Ansible troubleshooting - Unhandled exception while executing module win_user

    Thank you

    Introduction

    This book provides an introduction to the Ansible language.

    Ansible is a popular open source IT automation technology for scripting applications in a wide variety of domains.

    It is free, portable, powerful, and remarkably easy and fun to use.

    This book is a tool to learn the Ansible automation technology with some real-life examples.

    Whenever you are new to automation or a profession automation engineer, this book’s goal is to bring you quickly up to speed on the fundamentals of the core Ansible language.

    Every successful IT department needs automation nowadays for bare metal servers, virtual machines, cloud providers, containers, and edge computing. Automate your IT journey with Ansible automation technology.

    I’m going to teach you example by example how to accomplish the most common System Administrator tasks.

    You are going to start with the installation of Ansible in Windows 10 and Windows 11 and use the most command package manager and archives.

    Each of the 30+ lessons summarizes a module: from the most important parameter to some live demo of code and real-life usage. Each code is battle proved in the real life. Console interaction and verification are included in every video. A mundane activity like installing software, verifying a system is up-to-date, rebooting a server, installing Google Chrome, copying files from local controller to a remote system, could be automated with some lines of code and these are only some of the long lists included in the course.

    There are some Ansible codes usable in all the Windows systems and some specific for Windows Server.

    The Ansible troubleshooting lessons teaches you how to read the error message, how to reproduce, and the process of troubleshooting and resolution.

    Are you ready to automate your day with Ansible?

    Whois Luca Berton

    I’m Luca Berton and we’re going to have a lot of fun together.

    First of all, let me introduce myself.

    I’ve been Ansible Technical Support Engineer of Red Hat, based in the Czech Republic, even if I’m Italian.

    I’ve been more than 15 years System Administration, working with infrastructure, either on-premise or on the major cloud providers.

    I’m an enthusiast of the Open Source support the community by sharing my knowledge in different events of public access.

    I’m also a co-founder of my hometown Linux Users Group, visited by Richard Stallman, the founder of the Free Software Movement.

    I consider myself a lazy person so I always try new ways to automate the repetitive task of my work.

    After years of Perl, Bash, and python scripting I landed in Ansible technology. I took the certification and worked for more than a year with the Ansible Engineer Team.

    I consider Ansible the best infrastructure automation technology nowadays, it’s human-readable, the learning curve is accessible, and very requested by the recruiters in the market.

    This ultimate guide contains all of the obvious and not-so-obvious solutions using Ansible automation.

    In every lesson of this course, I’m going to share with you one specific use case, the possible solution, the code, the execution, and the verification of the target system.

    All these solutions are battle-tested and used by me in my everyday automation.

    You could easily jump between lessons and review again all the times that you need.

    Awards & Recognition

    2022

    Ansible Anwendertreffen - From Zero to Hero: How to build the Ansible Pilot Community - by Luca Berton (Red Hat CZ) 15:15 - 16:00 15 Feb 2022

    Red Hat Ansible Playbook included in RHSB-2021-009 Log4Shell - Remote Code Execution - log4j (CVE-2021-44228) 12 Jan 2022

    AWS Tip Set sysctl kernel parameters — Ansible module sysctl 12 Jan 2022

    The Ansible Bullhorn #41 - A Newsletter for the Ansible Developer Community 7 Jan 2022

    2021

    The Ansible Bullhorn #34 - A Newsletter for the Ansible Developer Community 17 Sep 2021

    The course is going to keep track of the evolution of the Ansible technology adding more content whenever is needed.


    Are you ready to have fun?

    Ansible For Beginners With Examples

    In this chapter you’re going to discover the Ansible Basics, Architecture and Terminology.

    What is Ansible

    In this chapter, I’ll explain to you what is Ansible and why it is so powerful for your IT department.

    Ansible

    Infrastructure Automation tool

    Open Source infrastructure as code

    First of all, let’s begin our adventure with the fabulous Open Source technology named Ansible. It is classified as an Infrastructure Automation tool, so you could automate your System Administrator tasks very easily. Infrastructure as code is the process of managing and provisioning computer data centers through machine-readable definition files, rather than physical hardware configuration or interactive configuration tools. Ansible follows the DevOps principles. With Ansible you could deploy your infrastructure as code on-premise and on the most well-known public cloud provider.

    Ansible three Use Cases

    Provision

    Config management

    Application deployment

    The three main use cases of Ansible are provision, configuration management, and app deployment. But after touching the technology I’m sure you could invent some more ways to use it!

    Provisioning

    The process of setting up the IT infrastructure

    Let’s start talking about provisioning: all the System Administrator know how important is to manage a uniform fleet of machines. Some people still rely on software to create workstation images. But there is a drawback, with imaging technology you’re only taking a snapshot in time of the machine. So every time you need to reinstall software because of the modern key activation systems or update manually to the latest security patches. Ansible is very powerful to automate this process being able to create a more smooth process.

    Configuration management

    The process for maintaining systems and software in a desired and consistent state

    The second key use case is configuration management: maintain up-to-date and in a consistent way all your fleet, coordinating rolling updates and scheduling downtime. With Ansible you could verify the status of your managed hosts and take action in a small group of them. A huge variety of modules is available for the most common use cases. Not to mention the common use case to check the compliance of your fleet to some international standard and apply resolution plans.

    Application deployment

    The process to publish your software between testing, staging and production environment

    The third key use case where Ansible is useful is Application deployment. It could automate the continuous integration / continuous delivery workflow pipeline of your web application for example. Your DevOps team will be delighted!.

    Ansible in DevOps

    Ansible is used to apply the DevOps principles in worldwide organizations. Let me quickly summarize.

    DevOps is a set of practices that combines software development (Dev) and IT operations (Ops). As DevOps is intended to be a cross-functional mode of working, those who practice the methodology use different sets of tools referred to as toolchains rather than a single one. These toolchains are expected to fit into one or more of the following categories, reflective of key aspects of the development and delivery process. The seven categories:

    Code: code development and review, source code management tools, code merging.

    Build: continuous integration tools, build status.

    Test: continuous testing tools that provide quick and timely feedback on business risks.

    Enjoying the preview?
    Page 1 of 1