Skip to content

Refactor developer docs #370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions docs/collection_creation.md

This file was deleted.

5 changes: 5 additions & 0 deletions docs/content_creation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Creating ansible content using ansible-creator and VS Code Ansible extension

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. If the command line is not your preferred method, the extension provides a user-friendly alternative. By navigating to the Ansible section in the VS Code activity bar and selecting "Ansible Development Tools," users can access a menu-driven interface. This GUI simplifies complex tasks by providing interactive forms for straightforward input. The extension enhances the development experience, offering visual cues and options for users who may find a graphical approach more comfortable and accessible. With ansible-creator in VS Code, you can effortlessly manage your Ansible content without delving into the intricacies of command-line operations.

Here is a detailed guide on creating an ansible content using the ansible-creator and VS Code Ansible extension: Add VS Code extension guild here when available.
6 changes: 1 addition & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ hide:

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.

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.

## Upcoming Features

The `add` command is currently under development which will allow you scaffold ansible plugins of your choice.
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.

## Licensing

Expand Down
80 changes: 57 additions & 23 deletions docs/installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ $ pip install ansible-creator

## CLI Usage

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.
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.

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).
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).

## Command line completion

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

### Initialize an Ansible collection project
## Initialize projects

### Initialize Ansible collection project

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

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

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

### Add support to existing project
### Initialize execution environment project

The `init execution_env` command enables you to initialize an Ansible execution environment project. Use the following command template:

```console
$ ansible-creator init execution_env <path>
```

Example:

```console
$ ansible-creator init execution_env $HOME/ansible-projects/ee-project
```

This command will scaffold the new execution environment playbook project at `/home/user/ansible-projects/ee-project`.

#### Generated Ansible execution environment project Structure

Running the `init execution_env` command generates an Ansible execution environment project with a comprehensive directory structure. Explore it using:

```console
$ tree -la /home/user/ansible-projects/ee-project
.
├── .github
│ └── workflows
│ └── ci.yml
├── .gitignore
├── README.md
└── execution-environment.yml
```

## Add resources

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.

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

### Add support to scaffold resource in an existing project
### Add resource to an existing project

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

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

#### Positional Arguments

| Parameter | Description |
| ------------ | ------------------------------------------------------ |
| devcontainer | Add devcontainer files to an existing Ansible project. |
| devfile | Add a devfile file to an existing Ansible project. |
| role | Add a role to an existing Ansible collection. |
| Parameter | Description |
| --------------------- | ---------------------------------------------------------------- |
| devcontainer | Add devcontainer files to an existing Ansible project. |
| devfile | Add a devfile file to an existing Ansible project. |
| role | Add a role to an existing Ansible collection. |
| execution-environment | Add a sample execution-environment.yml file to an existing path. |

#### Example
#### Example of adding a resource

```console
$ ansible-creator add resource devfile /home/user/..path/to/your/existing_project
$ ansible-creator add resource devcontainer /home/user/..path/to/your/existing_project
```

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

### Add support to scaffold plugins in an existing ansible collection
### Add plugins to an existing ansible collection

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

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

#### Positional Arguments

| Parameter | Description |
| --------- | -------------------------------------------------------------- |
| action | Add an action plugin to an existing Ansible Collection. |
| filter | Add a filter plugin to an existing Ansible Collection. |
| lookup | Add a lookup plugin to an existing Ansible Collection. |
| module | Add a generic module plugin to an existing Ansible Collection. |
| Parameter | Description |
| --------- | ------------------------------------------------------- |
| action | Add an action plugin to an existing Ansible Collection. |
| filter | Add a filter plugin to an existing Ansible Collection. |
| lookup | Add a lookup plugin to an existing Ansible Collection. |
| module | Add a generic module to an existing Ansible Collection. |

#### Example
#### Example of adding a plugin

```console
$ ansible-creator add plugin module test_plugin /home/user/..path/to/your/existing_project
$ ansible-creator add plugin action test_plugin /home/user/..path/to/your/existing_collection
```

This command will scaffold a generic module plugin at `/home/user/..path/to/your/existing_project`
This command will scaffold an action plugin at `/home/user/..path/to/your/existing_collection`
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ nav:
- home: index.md
- Setup:
- installing.md
- collection_creation.md
- content_creation.md
- Contributing: contributing.md

exclude_docs: |
Expand Down