-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AAP-33897 Devtools Add scaffolding collections chapter (#2404)
- Loading branch information
1 parent
339c146
commit 4a56bad
Showing
13 changed files
with
308 additions
and
1 deletion.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
downstream/assemblies/devtools/assembly-devtools-ansible-sign.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ifdef::context[:parent-context-of-devtools-ansible-sign: {context}] | ||
|
||
:_mod-docs-content-type: ASSEMBLY | ||
|
||
ifndef::context[] | ||
[id="devtools-ansible-sign"] | ||
endif::[] | ||
ifdef::context[] | ||
[id="devtools-ansible-sign_{context}"] | ||
endif::[] | ||
|
||
= Working with ansible-sign | ||
|
||
:context: devtools-ansible-sign | ||
|
||
// You must move roles into collections if you want to use them in {PlatformNameShort}. | ||
|
||
Working with ansible-sign | ||
|
||
// include::devtools/proc-devtools-zzz.adoc[leveloffset=+1] | ||
|
||
ifdef::parent-context-of-devtools-ansible-sign[:context: {parent-context-of-devtools-ansible-sign}] | ||
ifndef::parent-context-of-devtools-ansible-sign[:!context:] | ||
|
24 changes: 24 additions & 0 deletions
24
downstream/assemblies/devtools/assembly-devtools-builder.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ifdef::context[:parent-context-of-devtools-builder: {context}] | ||
|
||
:_mod-docs-content-type: ASSEMBLY | ||
|
||
ifndef::context[] | ||
[id="devtools-builder"] | ||
endif::[] | ||
ifdef::context[] | ||
[id="devtools-builder_{context}"] | ||
endif::[] | ||
|
||
= Working with {Builder} | ||
|
||
:context: devtools-builder | ||
|
||
// You must move roles into collections if you want to use them in {PlatformNameShort}. | ||
|
||
Working with {Builder} | ||
|
||
// include::devtools/proc-devtools-zzz.adoc[leveloffset=+1] | ||
|
||
ifdef::parent-context-of-devtools-builder[:context: {parent-context-of-devtools-builder}] | ||
ifndef::parent-context-of-devtools-builder[:!context:] | ||
|
25 changes: 25 additions & 0 deletions
25
downstream/assemblies/devtools/assembly-devtools-create-plugins-collection.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
ifdef::context[:parent-context-of-devtools-create-plugins-collection: {context}] | ||
|
||
:_mod-docs-content-type: ASSEMBLY | ||
|
||
ifndef::context[] | ||
[id="devtools-create-plugins-collection"] | ||
endif::[] | ||
ifdef::context[] | ||
[id="devtools-create-plugins-collection_{context}"] | ||
endif::[] | ||
|
||
= Creating a collection for distributing plug-ins and modules | ||
|
||
:context: devtools-create-plugins-collection | ||
|
||
// You must move roles into collections if you want to use them in {PlatformNameShort}. | ||
|
||
include::devtools/con-devtools-plan-plugins-collection.adoc[leveloffset=+1] | ||
include::devtools/con-devtools-plugins-collection-prerequisites.adoc[leveloffset=+1] | ||
|
||
include::devtools/proc-devtools-scaffold-roles-collection.adoc[leveloffset=+1] | ||
|
||
ifdef::parent-context-of-devtools-create-plugins-collection[:context: {parent-context-of-devtools-create-plugins-collection}] | ||
ifndef::parent-context-of-devtools-create-plugins-collection[:!context:] | ||
|
24 changes: 24 additions & 0 deletions
24
downstream/assemblies/devtools/assembly-devtools-lint.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ifdef::context[:parent-context-of-devtools-lint: {context}] | ||
|
||
:_mod-docs-content-type: ASSEMBLY | ||
|
||
ifndef::context[] | ||
[id="devtools-lint"] | ||
endif::[] | ||
ifdef::context[] | ||
[id="devtools-lint_{context}"] | ||
endif::[] | ||
|
||
= Working with ansible-lint | ||
|
||
:context: devtools-lint | ||
|
||
// You must move roles into collections if you want to use them in {PlatformNameShort}. | ||
|
||
Working with ansible-lint | ||
|
||
// include::devtools/proc-devtools-zzz.adoc[leveloffset=+1] | ||
|
||
ifdef::parent-context-of-devtools-lint[:context: {parent-context-of-devtools-lint}] | ||
ifndef::parent-context-of-devtools-lint[:!context:] | ||
|
24 changes: 24 additions & 0 deletions
24
downstream/assemblies/devtools/assembly-devtools-molecule.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ifdef::context[:parent-context-of-devtools-molecule: {context}] | ||
|
||
:_mod-docs-content-type: ASSEMBLY | ||
|
||
ifndef::context[] | ||
[id="devtools-molecule"] | ||
endif::[] | ||
ifdef::context[] | ||
[id="devtools-molecule_{context}"] | ||
endif::[] | ||
|
||
= Working with Molecule | ||
|
||
:context: devtools-molecule | ||
|
||
// You must move roles into collections if you want to use them in {PlatformNameShort}. | ||
|
||
Working with Molecule | ||
|
||
// include::devtools/proc-devtools-zzz.adoc[leveloffset=+1] | ||
|
||
ifdef::parent-context-of-devtools-molecule[:context: {parent-context-of-devtools-molecule}] | ||
ifndef::parent-context-of-devtools-molecule[:!context:] | ||
|
24 changes: 24 additions & 0 deletions
24
downstream/assemblies/devtools/assembly-devtools-navigator.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ifdef::context[:parent-context-of-devtools-navigator: {context}] | ||
|
||
:_mod-docs-content-type: ASSEMBLY | ||
|
||
ifndef::context[] | ||
[id="devtools-navigator"] | ||
endif::[] | ||
ifdef::context[] | ||
[id="devtools-navigator_{context}"] | ||
endif::[] | ||
|
||
= Working with {Navigator} | ||
|
||
:context: devtools-navigator | ||
|
||
// You must move roles into collections if you want to use them in {PlatformNameShort}. | ||
|
||
Working with {Navigator} | ||
|
||
// include::devtools/proc-devtools-zzz.adoc[leveloffset=+1] | ||
|
||
ifdef::parent-context-of-devtools-navigator[:context: {parent-context-of-devtools-navigator}] | ||
ifndef::parent-context-of-devtools-navigator[:!context:] | ||
|
24 changes: 24 additions & 0 deletions
24
downstream/assemblies/devtools/assembly-devtools-pytest-ansible.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ifdef::context[:parent-context-of-devtools-pytest-ansible: {context}] | ||
|
||
:_mod-docs-content-type: ASSEMBLY | ||
|
||
ifndef::context[] | ||
[id="devtools-pytest-ansible"] | ||
endif::[] | ||
ifdef::context[] | ||
[id="devtools-pytest-ansible_{context}"] | ||
endif::[] | ||
|
||
= Working with pytest-ansible | ||
|
||
:context: devtools-pytest-ansible | ||
|
||
// You must move roles into collections if you want to use them in {PlatformNameShort}. | ||
|
||
Working with pytest-ansible | ||
|
||
// include::devtools/proc-devtools-zzz.adoc[leveloffset=+1] | ||
|
||
ifdef::parent-context-of-devtools-pytest-ansible[:context: {parent-context-of-devtools-pytest-ansible}] | ||
ifndef::parent-context-of-devtools-pytest-ansible[:!context:] | ||
|
24 changes: 24 additions & 0 deletions
24
downstream/assemblies/devtools/assembly-devtools-tox-ansible.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ifdef::context[:parent-context-of-devtools-tox-ansible: {context}] | ||
|
||
:_mod-docs-content-type: ASSEMBLY | ||
|
||
ifndef::context[] | ||
[id="devtools-tox-ansible"] | ||
endif::[] | ||
ifdef::context[] | ||
[id="devtools-tox-ansible_{context}"] | ||
endif::[] | ||
|
||
= Working with tox-ansible | ||
|
||
:context: devtools-tox-ansible | ||
|
||
// You must move roles into collections if you want to use them in {PlatformNameShort}. | ||
|
||
Working with tox-ansible | ||
|
||
// include::devtools/proc-devtools-zzz.adoc[leveloffset=+1] | ||
|
||
ifdef::parent-context-of-devtools-tox-ansible[:context: {parent-context-of-devtools-tox-ansible}] | ||
ifndef::parent-context-of-devtools-tox-ansible[:!context:] | ||
|
7 changes: 7 additions & 0 deletions
7
downstream/modules/devtools/con-devtools-plan-plugins-collection.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
:_mod-docs-content-type: CONCEPT | ||
|
||
[id="plan-plugins-collection_{context}"] | ||
= Planning your collection of plugins and modules | ||
|
||
// Organize smaller bundles of curated automation into separate collections for specific functions, rather than creating one big general collection for all of your roles. | ||
|
15 changes: 15 additions & 0 deletions
15
downstream/modules/devtools/con-devtools-plugins-collection-prerequisites.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
:_mod-docs-content-type: CONCEPT | ||
|
||
[id="devtools-plugins-collection-prerequisites_{context}"] | ||
= Prerequisites | ||
|
||
* You have installed {VSCode} and the Ansible extension. | ||
* You have installed the Microsoft Dev Containers extension in {VSCode}. | ||
* You have installed {ToolsName}. | ||
* You have installed a containerization platform, for example Podman, Podman Desktop, Docker, or Docker Desktop. | ||
* You have a Red Hat account and you can log in to the Red Hat container registry at `registry.redhat.io`. | ||
For information about logging in to `registry.redhat.io`, see | ||
xref:devtools-setup-registry-redhat-io_installing-devtools[Authenticating with the Red Hat container registry]. | ||
// * Considerations about environments / isolation (ADE / devcontainer files) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
downstream/modules/devtools/proc-devtools-scaffold-plugins-collection.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
:_mod-docs-content-type: PROCEDURE | ||
|
||
[id="devtools-scaffold-plugins-collection_{context}"] | ||
= Scaffolding a collection for your plug-ins and modules | ||
|
||
You can scaffold a collection for plug-ins and modules from the Ansible extension in {VSCode}. | ||
|
||
.Procedure | ||
|
||
. Open {VSCode}. | ||
. Navigate to the directory where you want to create your collection. | ||
. Click the Ansible icon in the {VSCode} activity bar to open the Ansible extension. | ||
. Select *Get started* in the *Ansible content creator* section. | ||
+ | ||
The *Ansible content creator* tab opens. | ||
. In the *Create* section, click *Ansible collection project*. | ||
+ | ||
The *Create new Ansible project* tab opens. | ||
. In the form in the *Create Ansible project* tab, enter the following: | ||
** *Namespace*: Enter a name for your namespace, for example `company_namespace`. | ||
** *Collection*: Enter a name for your collection, for example, `myapp_network`. | ||
** *Init path*: Enter the path to the directory where you want to scaffold your new collection. | ||
+ | ||
If you enter an existing directory name, the scaffolding process overwrites the contents of that directory. | ||
The scaffold process only allows you to use an existing directory if you enable the Force option. | ||
|
||
*** If you are using the containerized version of Ansible development tools, | ||
the destination directory path is relative to the container, not a path in your local system. | ||
To discover the current directory name in the container, run the pwd command in a terminal in {VSCode}. | ||
If the current directory in the container is `workspaces`, enter `workspaces/<current_project>/collections`. | ||
*** If you are using a locally installed version of Ansible Dev tools, | ||
enter the full path to the directory, for example `/user/<username>/path/to/<collection_directory>`. | ||
. Click btn:[Create]. | ||
|
||
.Verification | ||
|
||
The following message appears in the *Logs* pane of the *Create Ansible collection* tab. | ||
// In this example, the destination directory name is | ||
|
||
---- | ||
--------------------- ansible-creator logs --------------------- | ||
Note: collection company_namespace.myapp_network created at /path/to/collections/directory | ||
---- | ||
|
||
The following directories and files are created in your `collections/` directory: | ||
|
||
---- | ||
├── .devcontainer | ||
├── .github | ||
├── .gitignore | ||
├── .isort.cfg | ||
├── .pre-commit-config.yaml | ||
├── .prettierignore | ||
├── .vscode | ||
├── CHANGELOG.rst | ||
├── CODE_OF_CONDUCT.md | ||
├── CONTRIBUTING | ||
├── LICENSE | ||
├── MAINTAINERS | ||
├── README.md | ||
├── changelogs | ||
├── devfile.yaml | ||
├── docs | ||
├── extensions | ||
├── galaxy.yml | ||
├── meta | ||
├── plugins | ||
├── pyproject.toml | ||
├── requirements.txt | ||
├── roles | ||
├── test-requirements.txt | ||
├── tests | ||
└── tox-ansible.ini | ||
---- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters