mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Add role skeleton support (#17079)
* Add role skeleton support The default role skeleton used by ansible-galaxy is good, but it doesn't allow organizations to customize it to suit their needs. This patch addresses that by adding the option to point ansible-galaxy at a role skeleton directory. The contents of this directory are then copied (or rendered) into the output role directory. Appropriate command line options and configuration entries are added to allow for further customization from the role skeleton. * Remove dependency on platforms list from test Platforms are no longer provided to the template by galaxy init. Removing the code in our test meta/main.yml template that relied on it. * Fix whitespace issue
This commit is contained in:
@@ -211,7 +211,31 @@ If you are creating a Container Enabled role, use the *--container-enabled* opti
|
||||
with default files appropriate for a Container Enabled role. For instance, the README.md has a slightly different structure, the *.travis.yml* file tests
|
||||
the role using `Ansible Container <https://github.com/ansible/ansible-container>`_, and the meta directory includes a *container.yml* file.
|
||||
|
||||
Search for roles
|
||||
Using a Custom Role Skeleton
|
||||
============================
|
||||
|
||||
A custom role skeleton directory can be supplied as follows:
|
||||
|
||||
::
|
||||
|
||||
$ ansible-galaxy init --role-skeleton=/path/to/skeleton role_name
|
||||
|
||||
When a skeleton is provided, init will:
|
||||
|
||||
- copy all files and directories from the skeleton to the new role
|
||||
- any .j2 files found outside of a templates folder will be rendered as templates. The only useful variable at the moment is role_name
|
||||
- The .git folder and any .git_keep files will not be copied
|
||||
|
||||
Alternatively, the role_skeleton and ignoring of files can be configured via ansible.cfg
|
||||
|
||||
::
|
||||
|
||||
[galaxy]
|
||||
role_skeleton = /path/to/skeleton
|
||||
role_skeleton_ignore = ^.git$,^.*/.git_keep$
|
||||
|
||||
|
||||
Search for Roles
|
||||
----------------
|
||||
|
||||
Search the Galaxy database by tags, platforms, author and multiple keywords. For example:
|
||||
|
||||
Reference in New Issue
Block a user