# Results of collection creation Used different methods to scaffold a collection. ## ansible-creator init collection ``` $ ansible-creator init collection test.testcollection ~/testcollection/ ``` ``` ├── CHANGELOG.rst ├── changelogs │   └── config.yaml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING ├── devfile.yaml ├── docs │   └── docsite │   └── links.yml ├── extensions │   ├── eda │   │   └── rulebooks │   │   └── rulebook.yml │   └── molecule │   ├── integration_hello_world │   │   └── molecule.yml │   └── utils │   ├── playbooks │   │   ├── converge.yml │   │   └── noop.yml │   └── vars │   └── vars.yml ├── galaxy.yml ├── LICENSE ├── MAINTAINERS ├── meta │   └── runtime.yml ├── plugins │   ├── action │   │   └── __init__.py │   ├── cache │   │   └── __init__.py │   ├── filter │   │   ├── hello_world.py │   │   └── __init__.py │   ├── inventory │   │   └── __init__.py │   ├── modules │   │   └── __init__.py │   ├── module_utils │   │   └── __init__.py │   ├── plugin_utils │   │   └── __init__.py │   ├── sub_plugins │   │   └── __init__.py │   └── test │   └── __init__.py ├── pyproject.toml ├── README.md ├── requirements.txt ├── roles │   └── run │   ├── defaults │   │   └── main.yml │   ├── files │   ├── handlers │   │   └── main.yml │   ├── meta │   │   └── main.yml │   ├── README.md │   ├── tasks │   │   └── main.yml │   ├── templates │   ├── tests │   │   └── inventory │   └── vars │   └── main.yml ├── test-requirements.txt ├── tests │   ├── integration │   │   ├── __init__.py │   │   ├── targets │   │   │   └── hello_world │   │   │   └── tasks │   │   │   └── main.yml │   │   └── test_integration.py │   └── unit │   ├── __init__.py │   └── test_basic.py └── tox-ansible.ini 39 directories, 42 files ``` ## ansible-galaxy collection init ``` ansible-galaxy collection init test.testcollection \ --init-path ~/testcollectiongalaxy/ ``` ``` └── test └── testcollection ├── docs ├── galaxy.yml ├── meta │   └── runtime.yml ├── plugins │   └── README.md ├── README.md └── roles 7 directories, 4 files ``` ## ansible-galaxy collection init --collection-skeleton ``` git clone git@github.com:ansible-collections/collection_template.git ``` ``` ansible-galaxy collection init test.collectiontemplate \ --collection-skeleton ~/git/collection_template/ \ --init-path ~/testcollectiongalaxy_template/ ``` ``` └── test └── collectiontemplate ├── CHANGELOG.rst ├── changelogs │   ├── changelog.yaml │   ├── config.yaml │   └── fragments ├── codecov.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── docs │   └── docsite │   └── links.yml ├── galaxy.yml ├── LICENSE ├── MAINTAINERS ├── meta │   ├── ee-bindep.txt │   ├── ee-requirements.txt │   ├── execution-environment.yml │   └── runtime.yml ├── README.md ├── REVIEW_CHECKLIST.md └── tests ├── integration │   └── targets └── units 12 directories, 16 files ``` ## ansible-galaxy collection init --collection-skeleton ## VSCode extension (Run one) 1. Install VSCode extension 2. Configure paths to ansible, ansible-creator, python executables 3. Select Ansible collection project "Create a structure for your Ansible collection that includes modules, plugins, molecule scenarios and tests." 4. Specify namespace, collection, init path fields. ``` ├── CHANGELOG.rst ├── changelogs │   └── config.yaml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING ├── devfile.yaml ├── docs │   └── docsite │   └── links.yml ├── extensions │   ├── eda │   │   └── rulebooks │   │   └── rulebook.yml │   └── molecule │   ├── integration_hello_world │   │   └── molecule.yml │   └── utils │   ├── playbooks │   │   ├── converge.yml │   │   └── noop.yml │   └── vars │   └── vars.yml ├── galaxy.yml ├── LICENSE ├── MAINTAINERS ├── meta │   └── runtime.yml ├── plugins │   ├── action │   │   └── __init__.py │   ├── cache │   │   └── __init__.py │   ├── filter │   │   ├── hello_world.py │   │   └── __init__.py │   ├── inventory │   │   └── __init__.py │   ├── modules │   │   └── __init__.py │   ├── module_utils │   │   └── __init__.py │   ├── plugin_utils │   │   └── __init__.py │   ├── sub_plugins │   │   └── __init__.py │   └── test │   └── __init__.py ├── pyproject.toml ├── README.md ├── requirements.txt ├── roles │   └── run │   ├── defaults │   │   └── main.yml │   ├── files │   ├── handlers │   │   └── main.yml │   ├── meta │   │   └── main.yml │   ├── README.md │   ├── tasks │   │   └── main.yml │   ├── templates │   ├── tests │   │   └── inventory │   └── vars │   └── main.yml ├── test-requirements.txt ├── tests │   ├── integration │   │   ├── __init__.py │   │   ├── targets │   │   │   └── hello_world │   │   │   └── tasks │   │   │   └── main.yml │   │   └── test_integration.py │   └── unit │   ├── __init__.py │   └── test_basic.py └── tox-ansible.ini 39 directories, 42 files ``` ## VSCode from source code (Run two) Same steps as previous but with the "install collection from source code (editable mode)" option selected. In this run I had collections installed under `~/.ansible`. ### First attempt ``` ├── CHANGELOG.rst ├── changelogs │   └── config.yaml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING ├── devfile.yaml ├── docs │   └── docsite │   └── links.yml ├── extensions │   ├── eda │   │   └── rulebooks │   │   └── rulebook.yml │   └── molecule │   ├── integration_hello_world │   │   └── molecule.yml │   └── utils │   ├── playbooks │   │   ├── converge.yml │   │   └── noop.yml │   └── vars │   └── vars.yml ├── galaxy.yml ├── LICENSE ├── MAINTAINERS ├── meta │   └── runtime.yml ├── plugins │   ├── action │   │   └── __init__.py │   ├── cache │   │   └── __init__.py │   ├── filter │   │   ├── hello_world.py │   │   └── __init__.py │   ├── inventory │   │   └── __init__.py │   ├── modules │   │   └── __init__.py │   ├── module_utils │   │   └── __init__.py │   ├── plugin_utils │   │   └── __init__.py │   ├── sub_plugins │   │   └── __init__.py │   └── test │   └── __init__.py ├── pyproject.toml ├── README.md ├── requirements.txt ├── roles │   └── run │   ├── defaults │   │   └── main.yml │   ├── files │   ├── handlers │   │   └── main.yml │   ├── meta │   │   └── main.yml │   ├── README.md │   ├── tasks │   │   └── main.yml │   ├── templates │   ├── tests │   │   └── inventory │   └── vars │   └── main.yml ├── test-requirements.txt ├── tests │   ├── integration │   │   ├── __init__.py │   │   ├── targets │   │   │   └── hello_world │   │   │   └── tasks │   │   │   └── main.yml │   │   └── test_integration.py │   └── unit │   ├── __init__.py │   └── test_basic.py └── tox-ansible.ini 39 directories, 42 files ``` ------------------------------- ansible-dev-environment logs -------------------------------- Hint: Run `rm -rf ~/.ansible/collections` to remove them. Command failed: bash -c 'source /home/dnaro/workspace/sandbox-venv/bin/activate && ade install --venv /home/dnaro/workspace/testcollectionvscodetwo/.venv --editable /home/dnaro/workspace/testcollectionvscodetwo --no-ansi -vvv ' Error: Collections found in /home/dnaro/.ansible/collections/ansible_collections Critical: The development environment is not isolated, please resolve the above errors. ### Second attempt In this run I removed all collections installed under `~/.ansible`. ``` ├── CHANGELOG.rst ├── changelogs │   └── config.yaml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING ├── devfile.yaml ├── docs │   └── docsite │   └── links.yml ├── extensions │   ├── eda │   │   └── rulebooks │   │   └── rulebook.yml │   └── molecule │   ├── integration_hello_world │   │   └── molecule.yml │   └── utils │   ├── playbooks │   │   ├── converge.yml │   │   └── noop.yml │   └── vars │   └── vars.yml ├── galaxy.yml ├── LICENSE ├── MAINTAINERS ├── meta │   └── runtime.yml ├── plugins │   ├── action │   │   └── __init__.py │   ├── cache │   │   └── __init__.py │   ├── filter │   │   ├── hello_world.py │   │   └── __init__.py │   ├── inventory │   │   └── __init__.py │   ├── modules │   │   └── __init__.py │   ├── module_utils │   │   └── __init__.py │   ├── plugin_utils │   │   └── __init__.py │   ├── sub_plugins │   │   └── __init__.py │   └── test │   └── __init__.py ├── pyproject.toml ├── README.md ├── requirements.txt ├── roles │   └── run │   ├── defaults │   │   └── main.yml │   ├── files │   ├── handlers │   │   └── main.yml │   ├── meta │   │   └── main.yml │   ├── README.md │   ├── tasks │   │   └── main.yml │   ├── templates │   ├── tests │   │   └── inventory │   └── vars │   └── main.yml ├── test-requirements.txt ├── tests │   ├── integration │   │   ├── __init__.py │   │   ├── targets │   │   │   └── hello_world │   │   │   └── tasks │   │   │   └── main.yml │   │   └── test_integration.py │   └── unit │   ├── __init__.py │   └── test_basic.py └── tox-ansible.ini 39 directories, 42 files ``` ------------------------------- ansible-dev-environment logs -------------------------------- Debug: Creating virtual environment: /home/dnaro/workspace/testcollectionvscodetwo/.venv Debug: Running command: python -m venv /home/dnaro/workspace/testcollectionvscodetwo/.venv Info: Created virtual environment: /home/dnaro/workspace/testcollectionvscodetwo/.venv Debug: Virtual environment: /home/dnaro/workspace/testcollectionvscodetwo/.venv Debug: Virtual environment interpreter: /home/dnaro/workspace/testcollectionvscodetwo/.venv/bin/python Debug: Running command: /home/dnaro/workspace/testcollectionvscodetwo/.venv/bin/python -c'import json,sysconfig; print(json.dumps(sysconfig.get_paths()))' {"stdlib": "/usr/lib64/python3.12", "platstdlib": "/home/dnaro/workspace/testcollectionvscodetwo/.venv/lib64/python3.12", "purelib": "/home/dnaro/workspace/testcollectionvscodetwo/.venv/lib/python3.12/site-packages", "platlib": "/home/dnaro/workspace/testcollectionvscodetwo/.venv/lib64/python3.12/site-packages", "include": "/usr/include/python3.12", "platinclude": "/usr/include/python3.12", "scripts": "/home/dnaro/workspace/testcollectionvscodetwo/.venv/bin", "data": "/home/dnaro/workspace/testcollectionvscodetwo/.venv"} Debug: Found site packages path: /home/dnaro/workspace/testcollectionvscodetw o/.venv/lib/python3.12/site-packages Info: Installing ansible-core. Debug: Installing ansible-core. Debug: Running command: /home/dnaro/workspace/testcollectionvscodetwo/.venv/bin/python -m pip install ansible-core Collecting ansible-core Using cached ansible_core-2.17.5-py3-none-any.whl.metadata (6.9 kB) Collecting jinja2>=3.0.0 (from ansible-core) Using cached jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB) Collecting PyYAML>=5.1 (from ansible-core) Using cached PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.1 kB) Collecting cryptography (from ansible-core) Using cached cryptography-43.0.3-cp39-abi3-manylinux_2_28_x86_64.whl.metadata (5.4 kB) Collecting packaging (from ansible-core) Using cached packaging-24.1-py3-none-any.whl.metadata (3.2 kB) Collecting resolvelib<1.1.0,>=0.5.3 (from ansible-core) Using cached resolvelib-1.0.1-py2.py3-none-any.whl.metadata (4.0 kB) Collecting MarkupSafe>=2.0 (from jinja2>=3.0.0->ansible-core) Using cached MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.0 kB) Collecting cffi>=1.12 (from cryptography->ansible-core) Using cached cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.5 kB) Collecting pycparser (from cffi>=1.12->cryptography->ansible-core) Using cached pycparser-2.22-py3-none-any.whl.metadata (943 bytes) Using cached ansible_core-2.17.5-py3-none-any.whl (2.2 MB) Using cached jinja2-3.1.4-py3-none-any.whl (133 kB) Using cached PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (767 kB) Using cached resolvelib-1.0.1-py2.py3-none-any.whl (17 kB) Using cached cryptography-43.0.3-cp39-abi3-manylinux_2_28_x86_64.whl (4.0 MB) Using cached packaging-24.1-py3-none-any.whl (53 kB) Using cached cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (479 kB) Using cached MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (23 kB) Using cached pycparser-2.22-py3-none-any.whl (117 kB) Installing collected packages: resolvelib, PyYAML, pycparser, packaging, MarkupSafe, jinja2, cffi, cryptography, ansible-core Successfully installed MarkupSafe-3.0.2 PyYAML-6.0.2 ansible-core-2.17.5 cffi-1.17.1 cryptography-43.0.3 jinja2-3.1.4 packaging-24.1 pycparser-2.22 resolvelib-1.0.1 Debug: Found local collection request without dependencies: /home/dnaro/workspace/testcollectionvscodetwo Debug: Setting collection path: /home/dnaro/workspace/testcollectionvscodetwo Debug: Setting request as local Debug: Found collection name: test.testcollectionvscodetwo from /home/dnaro/workspace/testcollectionvscodetwo/galaxy.yml. Info: Installing local collection from: /home/dnaro/workspace/testcollection vscodetwo/.venv/.ansible-dev-environment/test.testcollectionvscodetwo/ build Debug: List collection files using git ls-files. Debug: Running command: git ls-files 2> /dev/null Info: Failed to list collection using git ls-files: Command 'git ls-files 2> /dev/null' returned non-zero exit status 128. None Debug: List collection files using ls. Debug: Running command: ls 2> /dev/null CHANGELOG.rst changelogs CODE_OF_CONDUCT.md CONTRIBUTING devfile.yaml docs extensions galaxy.yml LICENSE MAINTAINERS meta plugins pyproject.toml README.md requirements.txt roles test-requirements.txt tests tox-ansible.ini Info: File list generated with 'ls' Debug: Found ansible-galaxy in virtual environment: /home/dnaro/workspace/testcollectionvscodetwo/.venv/bin/ansible-galaxy Debug: Running ansible-galaxy to build collection. Debug: Running command: cd /home/dnaro/workspace/testcollectionvscodetwo/.ven v/.ansible-dev-environment/test.testcollectionvscodetwo/build && /home/dnaro/workspace/testcollectionvscodetwo/.venv/bin/ansible-galaxy collection build --output-path /home/dnaro/workspace/testcollectionvsc odetwo/.venv/.ansible-dev-environment/test.testcollectionvscodetwo/bui ld --force Created collection for test.testcollectionvscodetwo at /home/dnaro/workspace/testcollectionvscodetwo/.venv/.ansible-dev-environment/test.testcollectionvscodetwo/build/test-testcollectionvscodetwo-1.0.0.tar.gz Debug: Found ansible-galaxy in virtual environment: /home/dnaro/workspace/testcollectionvscodetwo/.venv/bin/ansible-galaxy Debug: Running ansible-galaxy to install a local collection and it's dependencies. Debug: Running command: /home/dnaro/workspace/testcollectionvscodetwo/.venv/bin/ansible-galaxy collection install /home/dnaro/workspace/testcollectionvscodetwo/.venv /.ansible-dev-environment/test.testcollectionvscodetwo/build/test-test collectionvscodetwo-1.0.0.tar.gz -p /home/dnaro/workspace/testcollecti onvscodetwo/.venv/lib/python3.12/site-packages --force Starting galaxy collection install process Process install dependency map Starting collection install process Installing 'test.testcollectionvscodetwo:1.0.0' to '/home/dnaro/workspace/testcollectionvscodetwo/.venv/lib/python3.12/site-packages/ansible_collections/test/testcollectionvscodetwo' test.testcollectionvscodetwo:1.0.0 was installed successfully Note: Installed collections include: test.testcollectionvscodetwo Info: Swapping test.testcollectionvscodetwo with /home/dnaro/workspace/testcollectionvscodetwo Debug: Removing installed /home/dnaro/workspace/testcollectionvscodetwo/.venv /lib/python3.12/site-packages/ansible_collections/test/testcollectionv scodetwo Debug: Symlinking /home/dnaro/workspace/testcollectionvscodetwo/.venv/lib/pyt hon3.12/site-packages/ansible_collections/test/testcollectionvscodetwo to /home/dnaro/workspace/testcollectionvscodetwo Debug: Running command: ansible-builder introspect /home/dnaro/workspace/test collectionvscodetwo/.venv/lib/python3.12/site-packages --write-pip /ho me/dnaro/workspace/testcollectionvscodetwo/.venv/.ansible-dev-environm ent/discovered_requirements.txt --write-bindep /home/dnaro/workspace/t estcollectionvscodetwo/.venv/.ansible-dev-environment/discovered_binde p.txt --sanitize # Dependency data for /home/dnaro/workspace/testcollectionvscodetwo/.venv/lib/python3.12/site-packages --- python: [] system: [] Info: Installing python requirements. Debug: Installing python requirements from /home/dnaro/workspace/testcollecti onvscodetwo/.venv/.ansible-dev-environment/discovered_requirements.txt Debug: Running command: /home/dnaro/workspace/testcollectionvscodetwo/.venv/bin/python -m pip install -r /home/dnaro/workspace/testcollectionvscodetwo/.venv/.ansibl e-dev-environment/discovered_requirements.txt Note: All python requirements are installed. Info: Checking system packages. Debug: Running command: bindep -b -f /home/dnaro/workspace/testcollectionvsco detwo/.venv/.ansible-dev-environment/discovered_bindep.txt Note: All required system packages are installed. Note: A virtual environment was specified but has not been activated. Note: Please activate the virtual environment: source /home/dnaro/workspace/testcollectionvscodetwo/.venv/bin/activate