{ "info": { "author": "Andreas Lutro", "author_email": "anlutro@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# `adroit` - Ansible Docker Role Testing\n\nHeavily opinionated tool for testing Ansible roles using Docker containers.\n\n### Assumptions and limitations\n\nThese are the current assumptions about your Ansible codebase which might prevent you from using Adroit. They are subject to change or improve.\n\n- You only deploy (or only want to test) on modern systems with systemd as their init system.\n- You have a `base` role which other roles can build upon. (If you don't need this, you can just have an empty `roles/base` directory).\n- With the exception of depending on the base role, your Ansible roles are atomic, indepentent, and can be applied individually. `include_role` and dependencies defined in `meta` should still work, though.\n\nFeel free to open a Github issue about any limitations that prevent you from using Adroit.\n\n### How it works\n\n1. Adroit builds a *core image* based on your distro of choice.\n2. A container based on the core image is created. The `base` role will be applied to the container, and it is saved as the *base image*.\n3. For each role you want to test, a container based on the base image is started, and the role under test will be applied.\n\nAdroit will check if the role playbook fails, and will also run the playbook a second time to test for idempotency - if there are any changes on the second run, we consider it a failure.\n\n### Precautions\n\nTo properly test Ansible using Docker containers, systemd needs to be running inside the containers. This requires the containers to run in privileged mode. There is a security risk involved here, check your base images and playbooks accordingly.\n\n## Usage\n\nIn a virtualenv or whatever you prefer: `pip install adroit`\n\nIn the root directory of your Ansible tree structure, which should at least contain a `roles` directory, run this command:\n\n```bash\nadroit -d debian:stretch myrole\n```\n\nWhere `debian:stretch` is the image you want to base your tests on. Currently supported are Debian, Ubuntu and CentOS.\n\n### Customizing your roles for testing\n\nCertain tasks simply cannot be ran inside a Docker container - for example, mounting `/proc` with `hidepid=2`. You should add a `when` clause to these tasks. Example:\n\n```yaml\n- when: ansible_virtualization_type != 'docker'\n import_tasks: configure_network.yml\n```\n\nIf you need certain variables to be set which aren't in `defaults` or `vars` but should be set during testing, you can create a file like `roles/myrole/testing/test_vars.yml` and it will be applied when testing that particular role.\n\n## License\n\nThe contents of this repository is released under the [MIT license](http://opensource.org/licenses/MIT). See the LICENSE file included for details.\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "MIT", "maintainer": "Andreas Lutro", "maintainer_email": "anlutro@gmail.com", "name": "adroit", "package_url": "https://pypi.org/project/adroit/", "platform": "", "project_url": "https://pypi.org/project/adroit/", "project_urls": null, "release_url": "https://pypi.org/project/adroit/0.3/", "requires_dist": null, "requires_python": ">=3.5,<4.0", "summary": "Ansible Docker Role Testing", "version": "0.3" }, "last_serial": 4266122, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d5d4b7665521f3f70822bf45e9f20da0", "sha256": "a17710ab1ebf5cfd703e871291285106330ddbf1ac57a21974c7aee97f046bd5" }, "downloads": -1, "filename": "adroit-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d5d4b7665521f3f70822bf45e9f20da0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 13835, "upload_time": "2018-09-11T21:01:45", "url": "https://files.pythonhosted.org/packages/c8/7d/a990e3c8ca657ad1b842bf6103093ca13f7fb1cfaf04b57226ca18129890/adroit-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "51789e066c221f4cfad34a4e0aba5c1e", "sha256": "8143b85addc26825f9b2fd3a43c7d681ec687cbaf10037548f7bd234e319736a" }, "downloads": -1, "filename": "adroit-0.1.tar.gz", "has_sig": false, "md5_digest": "51789e066c221f4cfad34a4e0aba5c1e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 5224, "upload_time": "2018-09-11T21:01:47", "url": "https://files.pythonhosted.org/packages/ce/04/07c6834cab3865418d71bedb75edb71b70c52fc0ea616aace509d173d29d/adroit-0.1.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "459157028707848c7d1a5b6ae61e35ac", "sha256": "6501a50c841e82a1b0a41819bb3cf485a7e074de6afb3b2a983b10be1f5cc624" }, "downloads": -1, "filename": "adroit-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "459157028707848c7d1a5b6ae61e35ac", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 16637, "upload_time": "2018-09-12T19:12:24", "url": "https://files.pythonhosted.org/packages/ef/43/6249a40312b08a516ca5effa66222265c42d0e76bc9f466de05e005d6102/adroit-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d7021a0b9affc7471f0951596d85375b", "sha256": "a4b7b4ef294f00760dbdd60fe435a9bb8cbf40b8f1ea41253272b085ecea5987" }, "downloads": -1, "filename": "adroit-0.3.tar.gz", "has_sig": false, "md5_digest": "d7021a0b9affc7471f0951596d85375b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 6787, "upload_time": "2018-09-12T19:12:25", "url": "https://files.pythonhosted.org/packages/1b/ea/9d48850821a02571462d354f58ef537153537197b95b95a57e32e0599c7d/adroit-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "459157028707848c7d1a5b6ae61e35ac", "sha256": "6501a50c841e82a1b0a41819bb3cf485a7e074de6afb3b2a983b10be1f5cc624" }, "downloads": -1, "filename": "adroit-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "459157028707848c7d1a5b6ae61e35ac", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 16637, "upload_time": "2018-09-12T19:12:24", "url": "https://files.pythonhosted.org/packages/ef/43/6249a40312b08a516ca5effa66222265c42d0e76bc9f466de05e005d6102/adroit-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d7021a0b9affc7471f0951596d85375b", "sha256": "a4b7b4ef294f00760dbdd60fe435a9bb8cbf40b8f1ea41253272b085ecea5987" }, "downloads": -1, "filename": "adroit-0.3.tar.gz", "has_sig": false, "md5_digest": "d7021a0b9affc7471f0951596d85375b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 6787, "upload_time": "2018-09-12T19:12:25", "url": "https://files.pythonhosted.org/packages/1b/ea/9d48850821a02571462d354f58ef537153537197b95b95a57e32e0599c7d/adroit-0.3.tar.gz" } ] }