Skip to main content

A pip-like ansible collection installer.

Project description

ansible-dev-environment

A pip-like install for ansible collections.

Features

  • Promotes an "ephemeral" development approach
  • Ensures the current development environment is isolated
  • Install all collection python requirements
  • Install all collection test requirements
  • Checks for missing system packages
  • Symlinks the current collection into the current python interpreter's site-packages
  • Install all collection collection dependencies into the current python interpreter's site-packages

By placing collections into the python site-packages directory they are discoverable by ansible as well as python and pytest.

Usage

Setting up a development environment

$ pip install ansible-dev-environment --user
$ git clone <collection_repo>
$ cd <collection_repo>
$ ade install -e .\[test] --venv venv
INFO: Found collection name: network.interfaces from /home/bthornto/github/network.interfaces/galaxy.yml.
INFO: Creating virtual environment: /home/bthornto/github/network.interfaces/venv
INFO: Virtual environment: /home/bthornto/github/network.interfaces/venv
INFO: Using specified interpreter: /home/bthornto/github/network.interfaces/venv/bin/python
INFO: Requirements file /home/bthornto/github/network.interfaces/requirements.txt is empty, skipping
INFO: Installing python requirements from /home/bthornto/github/network.interfaces/test-requirements.txt
INFO: Installing ansible-core.
INFO: Initializing build directory: /home/bthornto/github/network.interfaces/build
INFO: Copying collection to build directory using git ls-files.
INFO: Running ansible-galaxy to build collection.
INFO: Running ansible-galaxy to install collection and it's dependencies.
INFO: Removing installed /home/bthornto/github/network.interfaces/venv/lib64/python3.11/site-packages/ansible_collections/network/interfaces
INFO: Symlinking /home/bthornto/github/network.interfaces/venv/lib64/python3.11/site-packages/ansible_collections/network/interfaces to /home/bthornto/github/network.interfaces
WARNING: A virtual environment was specified but has not been activated.
WARNING: Please activate the virtual environment:
source venv/bin/activate

Tearing down the development environment

$ ade uninstall ansible.scm
INFO     Found collection name: ansible.scm from /home/bthornto/github/ansible.scm/galaxy.yml.
INFO     Requirements file /home/bthornto/github/ansible.scm/requirements.txt is empty, skipping
INFO     Uninstalling python requirements from /home/bthornto/github/ansible.scm/test-requirements.txt
INFO     Removed ansible.utils: /home/bthornto/github/ansible.scm/venv/lib64/python3.11/site-packages/ansible_collections/ansible/utils
INFO     Removed ansible.utils*.info: /home/bthornto/github/ansible.scm/venv/lib64/python3.11/site-packages/ansible_collections/ansible.utils-2.10.3.info
INFO     Removed ansible.scm: /home/bthornto/github/ansible.scm/venv/lib64/python3.11/site-packages/ansible_collections/ansible/scm
INFO     Removed collection namespace root: /home/bthornto/github/ansible.scm/venv/lib64/python3.11/site-packages/ansible_collections/ansible
INFO     Removed collection root: /home/bthornto/github/ansible.scm/venv/lib64/python3.11/site-packages/ansible_collections

Help

ade --help

ade install --help

ade uninstall --help

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ansible-dev-environment-0.1.dev195.tar.gz (53.0 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file ansible-dev-environment-0.1.dev195.tar.gz.

File metadata

File hashes

Hashes for ansible-dev-environment-0.1.dev195.tar.gz
Algorithm Hash digest
SHA256 12a53511238b9d7efe267ba508718fba8ce41ba9987bdf7e5bbd44337aeaf8e5
MD5 36df20960692e2a4fbfaabfcbb733434
BLAKE2b-256 e477bab84579a43bf93751a229688577c55b227fdf1ff1539a1fb8cf472e1bf3

See more details on using hashes here.

File details

Details for the file ansible_dev_environment-0.1.dev195-py3-none-any.whl.

File metadata

File hashes

Hashes for ansible_dev_environment-0.1.dev195-py3-none-any.whl
Algorithm Hash digest
SHA256 3041fb89b5d3860c29140dd9a23a38c0c8641e643158773d72f57620b039bca9
MD5 e887a94264c79202ef4b61a356f8529a
BLAKE2b-256 0243c2433abf7d1b6ecb4e2093acfc59f958cb1db0ce3abbc37ecc089b260f24

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page