DevOps Classroom notes 27/Nov/2026

Build own collections

ac

Install collections

ansible-galaxy collection install amazon.aws --force

Crate own collections

  1. namespace: qt
  2. collection: demo

ansible-galaxy collection init qt.demo

galaxy.yml   README.md   meta/   plugins/   roles/   docs/

galaxy.yml – ID card of collection (name, version and author)

README.md – provide info about this collection how user can use it

plugins – where my modules and filtters live

roles – roles contains tasks, varibales, …etc

docs – info

meta – info of collections and its modules

build and install collection

 ansible-galaxy collection build

  ansible-galaxy collection install qt-demo-1.0.0.tar.gz --force
- name: demo
  hosts: all
  tasks:
    - name: Run the role
      ansible.builtin.include_role:
        name: qt.demo.hello

    - name: call module
      qt.demo.greet:
        name: student
      register: result

    - name: show result
      ansible.builtin.debug:
        msg: "{{ result.message }}"

Refer sample collection

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company
Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube