Skip to content

Latest commit

 

History

History
57 lines (38 loc) · 2.23 KB

developing_collections_creating.rst

File metadata and controls

57 lines (38 loc) · 2.23 KB

Creating collections

To create a collection:

  1. Create a :ref:`collection skeleton<creating_collections_skeleton>` with the collection init command.
  2. Add modules and other content to the collection.
  3. Build the collection into a collection artifact with :ref:`ansible-galaxy collection build<building_collections>`.
  4. Publish the collection artifact to Galaxy with :ref:`ansible-galaxy collection publish<publishing_collections>`.

A user can then install your collection on their systems.

To start a new collection:

collection_dir#> ansible-galaxy collection init my_namespace.my_collection

Note

Both the namespace and collection names use the same strict set of requirements. See Galaxy namespaces on the Galaxy docsite for those requirements.

Once the skeleton exists, you can populate the directories with the content you want inside the collection. See ansible-collections GitHub Org to get a better idea of what you can place inside a collection.

Reference: the ansible-galaxy collection command

Currently the ansible-galaxy collection command implements the following sub commands:

  • init: Create a basic collection skeleton based on the default template included with Ansible or your own template.
  • build: Create a collection artifact that can be uploaded to Galaxy or your own repository.
  • publish: Publish a built collection artifact to Galaxy.
  • install: Install one or more collections.

To learn more about the ansible-galaxy command-line tool, see the :ref:`ansible-galaxy` man page.

.. seealso::

   :ref:`collections`
       Learn how to install and use collections.
   :ref:`collection_structure`
       Directories and files included in the collection skeleton
   `Mailing List <https://groups.google.com/group/ansible-devel>`_
       The development mailing list
   `irc.freenode.net <http://irc.freenode.net>`_
       #ansible IRC chat channel