# How to create an Ansible Module/Library - Blog step-by-step

**URL:** <https://forum.ansible.com/t/how-to-create-an-ansible-module-library-blog-step-by-step/44749>\
**Category:** Guides, FAQs & Howtos\
**Tags:** module, howto\
**Created:** [October 27, 2025, 8:42pm UTC](https://forum.ansible.com/t/how-to-create-an-ansible-module-library-blog-step-by-step/44749 "2025-10-27T20:42:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Opvolger](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/opvolger/32/9724_2.png) [@Opvolger](https://forum.ansible.com/u/Opvolger)\
**Post date:** [October 27, 2025, 8:42pm UTC](https://forum.ansible.com/t/how-to-create-an-ansible-module-library-blog-step-by-step/44749/1 "2025-10-27T20:42:39Z")

</div>

Hello all,

I’ve personally created several Ansible modules, and to share this expertise, I’ve written a helpful blog post that may inspire others. I’ll walk you through the process of creating an Ansible module step by step. Here’s the link to the blog post I wrote.

[https://babelvis.nl/2025/10/17/how-to-create-an-ansible-module/](https://babelvis.nl/2025/10/17/how-to-create-an-ansible-module/)

Please note: English isn’t my native language 🙂 The blog post is in English, but the rest of the website is in Dutch.

Greetings, Bas.

---

<div class="post-metadata">

**Author:** ![Andersson007](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/andersson007/32/89_2.png) [@Andersson007](https://forum.ansible.com/u/Andersson007)\
**Post date:** [October 29, 2025, 9:38am UTC](https://forum.ansible.com/t/how-to-create-an-ansible-module-library-blog-step-by-step/44749/2 "2025-10-29T09:38:10Z")

</div>

@Opvolger hello, thanks for the blog post!  
I would suggest running `ansible-test sanity <you-module-file> --docker` against your module: I see a few things to improve.  
Thanks

---

<div class="post-metadata">

**Author:** ![Opvolger](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/opvolger/32/9724_2.png) [@Opvolger](https://forum.ansible.com/u/Opvolger)\
**Post date:** [October 31, 2025, 12:59pm UTC](https://forum.ansible.com/t/how-to-create-an-ansible-module-library-blog-step-by-step/44749/3 "2025-10-31T12:59:45Z")

</div>

I didn’t know that command. remove the 1ste line `#!/usr/bin/python` and format the code with the autopep8 plugin in vs-code and all the errors are gone.

Thnx learned something today 🙂

---

<div class="post-metadata">

**Author:** ![Andersson007](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/andersson007/32/89_2.png) [@Andersson007](https://forum.ansible.com/u/Andersson007)\
**Post date:** [November 3, 2025, 7:14am UTC](https://forum.ansible.com/t/how-to-create-an-ansible-module-library-blog-step-by-step/44749/4 "2025-11-03T07:14:11Z")

</div>

@Opvolger sure, you’re welcome!  
You can also check [this post](https://forum.ansible.com/t/want-to-become-a-code-contributor-to-modules-in-ansible-collections-read-on/39896) out for more ideas for your blog, in particular, a next step could be how to cover your module with integration tests to make sure it works as expected and how to run them locally. It’s in p. 3 Creating an Ansible collection with a simple module step-by-step.

---

<div class="post-metadata">

**Author:** ![Opvolger](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/opvolger/32/9724_2.png) [@Opvolger](https://forum.ansible.com/u/Opvolger)\
**Post date:** [November 3, 2025, 2:33pm UTC](https://forum.ansible.com/t/how-to-create-an-ansible-module-library-blog-step-by-step/44749/5 "2025-11-03T14:33:33Z")

</div>

all ready did make collections with test for work. Never make one publicly available. (where only intern usable) So i will start at p. 5
