Skip to content

Commit 1c22085

Browse files
authored
Refactor developer docs (#370)
* Refactor developer docs * Update content-creation.md
1 parent ca495b4 commit 1c22085

File tree

5 files changed

+70
-82
lines changed

5 files changed

+70
-82
lines changed

docs/collection_creation.md

Lines changed: 0 additions & 53 deletions
This file was deleted.

docs/content_creation.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Creating ansible content using ansible-creator and VS Code Ansible extension
2+
3+
- For users who prefer a graphical interface, ansible-creator seamlessly integrates with the [Visual Studio Code (VS Code)](https://code.visualstudio.com/docs) and the [Ansible extension](https://marketplace.visualstudio.com/items?itemName=redhat.ansible) for it, offering an intuitive GUI experience.
4+
5+
- By navigating to the Ansible section in the VS Code activity bar and selecting "Ansible Development Tools," users can access a menu-driven interface.
6+
7+
- This GUI provides interactive forms for straightforward input. So you can effortlessly manage your Ansible content without delving into the intricacies of command-line operations.
8+
9+
- Here is a detailed [guide](https://ansible.readthedocs.io/projects/vscode-ansible/) on creating an ansible content using the ansible-creator and VS Code Ansible extension.
10+
11+
#TO-DO: Add VS Code extension guide here when its available.

docs/index.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ hide:
88

99
The `ansible-creator` is a Command-Line Interface (CLI) tool designed for effortlessly scaffolding all your Ansible content. Whether you are initializing an Ansible Collection or creating the framework for specific plugins, this tool streamlines the process with efficiency and precision based on your requirements.
1010

11-
This documentation serves as a detailed guide for using ansible-creator, emphasizing the 'init' functionality for initializing Ansible Collections. Stay tuned for updates on the 'create' branch that will bring new features to enhance your Ansible workflow.
12-
13-
## Upcoming Features
14-
15-
The `add` command is currently under development which will allow you scaffold ansible plugins of your choice.
11+
This documentation serves as a detailed guide for using ansible-creator, emphasizing the 'init' and 'add' functionalities. The 'init' functionality initializes a new Ansible project whereas 'add' enables you to add resources to an existing ansible project.
1612

1713
## Licensing
1814

docs/installing.md

Lines changed: 57 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ $ pip install ansible-creator
1414

1515
## CLI Usage
1616

17-
The Command-Line Interface (CLI) for ansible-creator provides a straightforward and efficient way to interact with the tool. Users can initiate actions, such as initializing Ansible Collections, through concise commands. The CLI is designed for simplicity, allowing users to execute operations with ease and without the need for an extensive understanding of the tool's intricacies. It serves as a flexible and powerful option for users who prefer command-line workflows, enabling them to integrate ansible-creator seamlessly into their development processes.
17+
The Command-Line Interface (CLI) for ansible-creator provides a straightforward and efficient way to interact with the tool. Users can initiate actions, such as initializing Ansible Collections and other Ansible Projects, through concise commands. The CLI is designed for simplicity, allowing users to execute operations with ease and without the need for an extensive understanding of the tool's intricacies. It serves as a flexible and powerful option for users who prefer command-line workflows, enabling them to integrate ansible-creator seamlessly into their development processes.
1818

19-
If command line is not your preferred method, you can also leverage the GUI interface within VS Code's Ansible extension that offers a more visually intuitive experience of ansible-creator. See [here](collection_creation.md).
19+
If command line is not your preferred method, you can also leverage the GUI interface within VS Code's Ansible extension that offers a more visually intuitive experience of ansible-creator. See [here](content_creation.md).
2020

2121
## Command line completion
2222

@@ -35,7 +35,9 @@ Get an overview of available commands and options by running:
3535
$ ansible-creator --help
3636
```
3737

38-
### Initialize an Ansible collection project
38+
## Initialize projects
39+
40+
### Initialize Ansible collection project
3941

4042
The `init collection` command enables you to initialize an Ansible collection project. Use the following command template:
4143

@@ -282,7 +284,38 @@ It also comes equipped with Github Action Workflows that use [ansible-content-ac
282284

283285
Please ensure that you review any potential `TO-DO` items in the scaffolded content and make the necessary modifications according to your requirements.
284286

285-
### Add support to existing project
287+
### Initialize execution environment project
288+
289+
The `init execution_env` command enables you to initialize an Ansible execution environment project. Use the following command template:
290+
291+
```console
292+
$ ansible-creator init execution_env <path>
293+
```
294+
295+
Example:
296+
297+
```console
298+
$ ansible-creator init execution_env $HOME/ansible-projects/ee-project
299+
```
300+
301+
This command will scaffold the new execution environment playbook project at `/home/user/ansible-projects/ee-project`.
302+
303+
#### Generated Ansible execution environment project Structure
304+
305+
Running the `init execution_env` command generates an Ansible execution environment project with a comprehensive directory structure. Explore it using:
306+
307+
```console
308+
$ tree -la /home/user/ansible-projects/ee-project
309+
.
310+
├── .github
311+
│ └── workflows
312+
│ └── ci.yml
313+
├── .gitignore
314+
├── README.md
315+
└── execution-environment.yml
316+
```
317+
318+
## Add resources
286319

287320
The `add` subcommand allows users to scaffold content types like resources and plugins into an existing project. This feature is designed to streamline the development environment setup by automatically generating the necessary configuration files.
288321

@@ -307,7 +340,7 @@ $ ansible-creator add --help
307340
| ---------- | --------- | ------------- | -------------------------------- |
308341
| -h | --help | | Show this help message and exit. |
309342

310-
### Add support to scaffold resource in an existing project
343+
### Add resource to an existing project
311344

312345
The `add resource` command enables you to add a resource to an already existing project. Use the following command template:
313346

@@ -317,21 +350,22 @@ $ ansible-creator add resource <resource-type> <path>
317350

318351
#### Positional Arguments
319352

320-
| Parameter | Description |
321-
| ------------ | ------------------------------------------------------ |
322-
| devcontainer | Add devcontainer files to an existing Ansible project. |
323-
| devfile | Add a devfile file to an existing Ansible project. |
324-
| role | Add a role to an existing Ansible collection. |
353+
| Parameter | Description |
354+
| --------------------- | ---------------------------------------------------------------- |
355+
| devcontainer | Add devcontainer files to an existing Ansible project. |
356+
| devfile | Add a devfile file to an existing Ansible project. |
357+
| role | Add a role to an existing Ansible collection. |
358+
| execution-environment | Add a sample execution-environment.yml file to an existing path. |
325359

326-
#### Example
360+
#### Example of adding a resource
327361

328362
```console
329-
$ ansible-creator add resource devfile /home/user/..path/to/your/existing_project
363+
$ ansible-creator add resource devcontainer /home/user/..path/to/your/existing_project
330364
```
331365

332-
This command will scaffold the devfile.yaml file at `/home/user/..path/to/your/existing_project`
366+
This command will scaffold the devcontainer directory at `/home/user/..path/to/your/existing_project`
333367

334-
### Add support to scaffold plugins in an existing ansible collection
368+
### Add plugins to an existing ansible collection
335369

336370
The `add plugin` command enables you to add a plugin to an existing collection project. Use the following command template:
337371

@@ -341,17 +375,17 @@ $ ansible-creator add plugin <plugin-type> <plugin-name> <collection-path>
341375

342376
#### Positional Arguments
343377

344-
| Parameter | Description |
345-
| --------- | -------------------------------------------------------------- |
346-
| action | Add an action plugin to an existing Ansible Collection. |
347-
| filter | Add a filter plugin to an existing Ansible Collection. |
348-
| lookup | Add a lookup plugin to an existing Ansible Collection. |
349-
| module | Add a generic module plugin to an existing Ansible Collection. |
378+
| Parameter | Description |
379+
| --------- | ------------------------------------------------------- |
380+
| action | Add an action plugin to an existing Ansible Collection. |
381+
| filter | Add a filter plugin to an existing Ansible Collection. |
382+
| lookup | Add a lookup plugin to an existing Ansible Collection. |
383+
| module | Add a generic module to an existing Ansible Collection. |
350384

351-
#### Example
385+
#### Example of adding a plugin
352386

353387
```console
354-
$ ansible-creator add plugin module test_plugin /home/user/..path/to/your/existing_project
388+
$ ansible-creator add plugin action test_plugin /home/user/..path/to/your/existing_collection
355389
```
356390

357-
This command will scaffold a generic module plugin at `/home/user/..path/to/your/existing_project`
391+
This command will scaffold an action plugin at `/home/user/..path/to/your/existing_collection`

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ nav:
6767
- home: index.md
6868
- Setup:
6969
- installing.md
70-
- collection_creation.md
70+
- content_creation.md
7171
- Contributing: contributing.md
7272

7373
exclude_docs: |

0 commit comments

Comments
 (0)