DEV Community

Nitin Namdev
Nitin Namdev

Posted on

1

Ansible Sandbox for Developing Custom Module

Hello all,

Today ansible is the most popular tool in the automation part, so for creating playbook, roles and modules you need to do too much manual work, for getting rid from this I have created a script that will create a ansible role structure with tasks, handlers, deafults, template and library

And also I created a hello custom module that is called in the task so you can work without any manual work, you can directly run the command and you will have ready to go ansible environment.

Simply run the following command —

cd /opt/
wget -O - https://raw.githubusercontent.com/vortexdude/src/main/script.sh | bash -s newrole
Enter fullscreen mode Exit fullscreen mode

After running the above command in your linux you need the package of ansible and wget and git.

to run the ansible playbook —

ansible-playbook ansible/main.yml 
Enter fullscreen mode Exit fullscreen mode

also it will create the inventory file where you can define you all of the servers the path of the inventory will be inventory/all.

hello.py is your custom module and the file wll be in the following location

vi ansible/roles/newrole/library/hello.py
Enter fullscreen mode Exit fullscreen mode

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Retry later