Custom hello-world Ansible Filter Plugin

Unveiling Ansible’s “hello-world” Filter Plugin in foo.bar: A Glimpse into Personalized Automation

Luca Berton

--

Introduction

In the world of automation and configuration management, Ansible plays a pivotal role in simplifying complex tasks and orchestrating diverse systems. One of the key features that makes Ansible highly versatile is the ability to extend its functionality through plugins. In this article, we’ll dive into the “hello-world” filter plugin written in Python for Ansible within the foo.bar namespace.

Understanding the Basics

The “hello-world” filter plugin is a simple yet illustrative example of a filter plugin in Ansible. The purpose of this plugin is to generate a personalized greeting message, taking a name as input and returning a “Hello, [name]” message.

"""A hello-world filter plugin in foo.bar collection."""

from __future__ import absolute_import, division, print_function

__metaclass__ = type

DOCUMENTATION = r"""
name: hello-world
author: Luca Berton <luca@ansiblepilot.com>
version_added: "1.0.0" # same as collection version
short_description: hello world
description:
- This filter returns the hello from a name input.
positional: _input
options…

--

--

Luca Berton
Luca Berton

Written by Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday