|
| 1 | +:_mod-docs-content-type: PROCEDURE |
| 2 | + |
| 3 | +[id="devtools-scaffold-plugins-collection_{context}"] |
| 4 | += Scaffolding a collection for your plug-ins and modules |
| 5 | + |
| 6 | +You can scaffold a collection for plug-ins and modules from the Ansible extension in {VSCode}. |
| 7 | + |
| 8 | +.Procedure |
| 9 | + |
| 10 | +. Open {VSCode}. |
| 11 | +. Navigate to the directory where you want to create your collection. |
| 12 | +. Click the Ansible icon in the {VSCode} activity bar to open the Ansible extension. |
| 13 | +. Select *Get started* in the *Ansible content creator* section. |
| 14 | ++ |
| 15 | +The *Ansible content creator* tab opens. |
| 16 | +. In the *Create* section, click *Ansible collection project*. |
| 17 | ++ |
| 18 | +The *Create new Ansible project* tab opens. |
| 19 | +. In the form in the *Create Ansible project* tab, enter the following: |
| 20 | +** *Namespace*: Enter a name for your namespace, for example `company_namespace`. |
| 21 | +** *Collection*: Enter a name for your collection, for example, `myapp_network`. |
| 22 | +** *Init path*: Enter the path to the directory where you want to scaffold your new collection. |
| 23 | ++ |
| 24 | +If you enter an existing directory name, the scaffolding process overwrites the contents of that directory. |
| 25 | +The scaffold process only allows you to use an existing directory if you enable the Force option. |
| 26 | + |
| 27 | +*** If you are using the containerized version of Ansible development tools, |
| 28 | +the destination directory path is relative to the container, not a path in your local system. |
| 29 | +To discover the current directory name in the container, run the pwd command in a terminal in {VSCode}. |
| 30 | +If the current directory in the container is `workspaces`, enter `workspaces/<current_project>/collections`. |
| 31 | +*** If you are using a locally installed version of Ansible Dev tools, |
| 32 | +enter the full path to the directory, for example `/user/<username>/path/to/<collection_directory>`. |
| 33 | +. Click btn:[Create]. |
| 34 | + |
| 35 | +.Verification |
| 36 | + |
| 37 | +The following message appears in the *Logs* pane of the *Create Ansible collection* tab. |
| 38 | +// In this example, the destination directory name is |
| 39 | + |
| 40 | +---- |
| 41 | +--------------------- ansible-creator logs --------------------- |
| 42 | +
|
| 43 | + Note: collection company_namespace.myapp_network created at /path/to/collections/directory |
| 44 | +---- |
| 45 | + |
| 46 | +The following directories and files are created in your `collections/` directory: |
| 47 | + |
| 48 | +---- |
| 49 | +├── .devcontainer |
| 50 | +├── .github |
| 51 | +├── .gitignore |
| 52 | +├── .isort.cfg |
| 53 | +├── .pre-commit-config.yaml |
| 54 | +├── .prettierignore |
| 55 | +├── .vscode |
| 56 | +├── CHANGELOG.rst |
| 57 | +├── CODE_OF_CONDUCT.md |
| 58 | +├── CONTRIBUTING |
| 59 | +├── LICENSE |
| 60 | +├── MAINTAINERS |
| 61 | +├── README.md |
| 62 | +├── changelogs |
| 63 | +├── devfile.yaml |
| 64 | +├── docs |
| 65 | +├── extensions |
| 66 | +├── galaxy.yml |
| 67 | +├── meta |
| 68 | +├── plugins |
| 69 | +├── pyproject.toml |
| 70 | +├── requirements.txt |
| 71 | +├── roles |
| 72 | +├── test-requirements.txt |
| 73 | +├── tests |
| 74 | +└── tox-ansible.ini |
| 75 | +
|
| 76 | +---- |
| 77 | + |
| 78 | + |
0 commit comments