Skip to main content

Example Ansible Collection containing 'boo' Ansible module

Project description

ansible-collections.python.dist.boo @ PyPI GitHub Actions CI/CD build status — Publish Python 🐍 distributions 📦 to PyPI and TestPyPI

ansible-collections.python.dist.boo: an Ansible Collection containing a boo module

This is a demo of an Ansible Collection python.dist packaged as a Python distribution package. It contains only one Ansible module called boo. Given that this dist and Ansible are installed into the same (virtual)env, it’s accessible from Ansible by FQDN python.dist.boo. Here’s how you can call it adhoc-style:

$ PYTHONPATH=`pwd` ansible -m python.dist.boo -a name=Bob localhost
[WARNING]: No inventory was parsed, only implicit localhost is available
localhost | SUCCESS => {
    "changed": false,
    "greeting": "Hello, Bob!",
    "msg": "Greeting Bob completed."
}

Alternatively, install it, instead of mangling with PYTHONPATH:

$ pip install ansible-collections.python.dist.boo
$ ansible -m python.dist.boo -a name=Bob localhost
[WARNING]: No inventory was parsed, only implicit localhost is available
localhost | SUCCESS => {
    "changed": false,
    "greeting": "Hello, Bob!",
    "msg": "Greeting Bob completed."
}

Purpose

At the moment of publishing this project, this demo only works with the code supplied by Ansible PR #67093. One can test it by installing Ansible from that PR-branch:

$ pip install git+https://github.com/sivel/ansible@acd-content-dir

Publishing to PyPI

This project implements automatic building and publishing of a Python distribution package to PyPI for tagged commits and to TestPyPI for every push to master. All the heavy lifting is done by the combination of GitHub Actions CI/CD workflows, pep517 CLI tool and setuptools-scm.

The published dists are then installable by:

$ pip install ansible-collections.python.dist.boo  # for PyPI

and

$ pip install ansible-collections.python.dist.boo \
      -i https://test.pypi.org/simple/ --pre  # for TestPyPI

If you’re learning by example, take a look at the following files:

  • pyproject.toml

  • setup.cfg

  • .github/workflows/publish-to-test-pypi.yml

Besides, you can follow a PyPA guide about publishing packages via GitHub Actions that will walk you through the process.

Prerequisites

Python 3.7+

License

The source code and the documentation in this project are released under the GPL v3 license.

Download files

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

Source Distribution

ansible-collections.python.dist.boo-0.1.1.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

ansible_collections.python.dist.boo-0.1.1-py2.py3-none-any.whl (17.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ansible-collections.python.dist.boo-0.1.1.tar.gz.

File metadata

  • Download URL: ansible-collections.python.dist.boo-0.1.1.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for ansible-collections.python.dist.boo-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f2738d3d34a9039840aa98dc3e02e40d0a968103094825f5ccf6835f7eab0a68
MD5 4b79c7110b7a3d2507da9a1bf09ccb51
BLAKE2b-256 f562daec3475ca0949af207d852ba7a39eb25158dfafbf7a052e2dd9d7bd2964

See more details on using hashes here.

File details

Details for the file ansible_collections.python.dist.boo-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for ansible_collections.python.dist.boo-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d6364b189ed10f5255eddc53167fa5f9a1a49dfacc2166e299821fcfddeb0e64
MD5 7c517cba8935b593f3cd13dd1954817f
BLAKE2b-256 7f601c2cb33a9c5c52d355970f8b83c09b34c5433b293ae125db3246e626d044

See more details on using hashes here.

Supported by

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