In Class Demo

Our demo introduced the basic usage of ansible and showcased the ability to assess and manage various configurations on a group of client machines. This is very scalable! Not only to additional clients, but also additional platforms.

For reference we used examples in the following git repo:

https://github.com/redmondmj/ansible_lab

Part A: What’s Next? (Windows Example)

Probably Windows! There are a number of ways to authenticate to our Windows hosts and a number of modules that we can use to manage Windows servers and clients!

To test a simple password based authentication

  1. Identify a (maybe a few) target Windows client(s) and ensure network connectivity. Options:

    1. Spin up Local VMs (Like your Intune VM)
    2. Use a lab machine (Lab 312 only)
    3. ProxMox - Msg me if you need one.
  2. Prepare the client machine

    1. Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force

    2. Enable-PSRemoting -SkipNetworkProfileCheck

    3. Run the script

      ansible.ps1

  3. Add the Windows hosts and their creds to your inventory file on your Ansible Control Node

  4. Your Ansible Control Node will use a python module to execute WinRM tasks so you should probably install it using pip (this may already be installed)

    1. sudo apt install python3-pip
    2. pip install pywinrm --break-system-packages
  5. You may also want to use the Windows Modules, make sure they are installed:

    1. ansible-galaxy collection install ansible.windows

    <aside> ☝🏽

    Notice: If your playbook requires other modules, you can use this same method to add them!

    </aside>

  6. Test connectivity by running an ad-hoc command like ping

    1. ansible -i inventory.ini windows -m win_ping
  7. Run some playbooks!

    You’ll find some examples already provided in the git repo:

    ansible-playbook -i inventory.ini playbooks/playbookDemo.yml

    Screenshot the Demo Playbook output!

Part B: Roll Your own demo

https://github.com/redmondmj/ansible_lab/tree/master/playbooks

AI Is good at writing these playbooks , but be careful not to let it over complicate things. Ansible is intended to be simple!

  1. Create and your own playbook.