Ansible 101 - Episode 13 - Ansible Collections and a Test Plugin



Jeff Geerling (geerlingguy) introduces Ansible Content Collections; their history, what they can do, and how they can be used. In the course of the demonstration, we also build a simple test plugin, ‘blue’, to check if a given string is a valid CSS form of blue or not.

Ansible for DevOps: https://www.ansiblefordevops.com

Support Jeff on GitHub: https://github.com/sponsors/geerlingguy
Support Jeff on Patreon: https://www.patreon.com/geerlingguy

Contents:

00:00:00 – Start
00:00:28 – Intro
00:02:52 – Questions from previous episode
00:08:23 – Intro Collections and new chapter
00:09:42 – History of Ansible Collections
00:20:01 – Creating a Test Plugin with Python
00:37:13 – Creating a collection
00:41:46 – Moving our plugin into the collection
00:43:00 – Using the FQCN
00:46:37 – Collections on Ansible Galaxy
00:48:08 – Installing collections from Galaxy
00:52:55 – Other Collection features
01:00:50 – Outtro

source

21 thoughts on “Ansible 101 – Episode 13 – Ansible Collections and a Test Plugin”
  1. Good video. Do you have any post or video that explains the use of custom developed collections to be consumed from a git repository?
    I have a playbook that I run from ansible tower and it has the collections / requirements.yml file pointing to the git repository where I keep my collection, but it can't find it.

  2. Develop a python course for system administration. Geared towards Linux. Python for Linux Scripting.

  3. -i accepts an inventory file, or a comma separated list. If there was no comma, it's not a list, so ansible would be looking for a file. But with the comma, it's a list.

  4. Building with Pi's as an exercise has advantages. Cost to build…home labs is far easier to afford a few PI's than the same number of NUCs. Also, learning to minimize resource usage will pay dividends when you're doing it for money, and the customer has limited resources. Building for simplicity should be the other half of the exercise. Simplicity in production makes troubleshooting easier.

  5. Great video series, have hardcopy of your book but just purchased on leanpub too. Keep the videos coming, really enjoying the series. Love that you're doing this. Hope you're feeling better.

  6. Just bought your book, looking forward to reading it. Many thanks for helping us learn Jeff.

  7. @geerlinguy When should I put roles in the collection as opposed to separate from the collection?

  8. Great series Jeff. Thank you very much. If you could create a video on how to install collections on remote servers without internet it would be really helpful.

  9. When will I be able to install ansible-core 2.10 and then the few modules I need for my project? We are using Ansible as a middleware and security team is complaining about the thousands of unused modules that are lying around in the docker-image. Thanks!

  10. You mentioned Ansible on Windows. I have it working on WSL2, more ore less. Creatied my own dev playbook for Windows.
    Looking into bootstrapping the Chocolatey installation now from within WSL2. Will share it on GitHub later. Molecule works with WSL2 Docker after some tricks.
    KVM2 with nested virtualization does not work yet. I tried with a custom build kernel.
    Packer with Ansible 2 does no longer work. I think can get that working.

Leave a Reply

Your email address will not be published.

Captcha loading...