{"id":15140828,"url":"https://github.com/ansible-community/molecule-inspec","last_synced_at":"2025-09-29T10:30:37.247Z","repository":{"id":45330882,"uuid":"209103681","full_name":"ansible-community/molecule-inspec","owner":"ansible-community","description":"Molecule Inspec Verifier Plugin","archived":true,"fork":false,"pushed_at":"2023-01-02T19:28:13.000Z","size":56,"stargazers_count":13,"open_issues_count":10,"forks_count":9,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-09-22T13:32:58.266Z","etag":null,"topics":["ansible","molecule","molecule-plugin"],"latest_commit_sha":null,"homepage":"https://github.com/ansible/molecule","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ansible-community.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-17T16:27:49.000Z","updated_at":"2023-01-06T14:43:39.000Z","dependencies_parsed_at":"2023-02-01T04:00:37.805Z","dependency_job_id":null,"html_url":"https://github.com/ansible-community/molecule-inspec","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-community%2Fmolecule-inspec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-community%2Fmolecule-inspec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-community%2Fmolecule-inspec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-community%2Fmolecule-inspec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ansible-community","download_url":"https://codeload.github.com/ansible-community/molecule-inspec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219874048,"owners_count":16554541,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","molecule","molecule-plugin"],"created_at":"2024-09-26T08:41:37.413Z","updated_at":"2025-09-29T10:30:36.953Z","avatar_url":"https://github.com/ansible-community.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"**********************\nMolecule Inspec Plugin\n**********************\n\n.. image:: https://badge.fury.io/py/molecule-inspec.svg\n   :target: https://badge.fury.io/py/molecule-inspec\n   :alt: PyPI Package\n\n.. image:: https://github.com/ansible-community/molecule-inspec/workflows/tox/badge.svg\n   :target: https://github.com/ansible-community/molecule-inspec/actions\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n   :target: https://github.com/python/black\n   :alt: Python Black Code Style\n\n.. image:: https://img.shields.io/badge/Code%20of%20Conduct-Ansible-silver.svg\n   :target: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html\n   :alt: Ansible Code of Conduct\n\n.. image:: https://img.shields.io/badge/license-MIT-brightgreen.svg\n   :target: LICENSE\n   :alt: Repository License\n\nMolecule Inspec Plugin is designed to allow use of inspec as a verifier.\nThe initialization of a role or scenario with the inspec verifier configures a\nVerify playbook which installs inspec, copies the tests, and executes inspec on\nthe instance.\n\nDocumentation\n=============\n\n.. _installation-and-usage:\n\nInstallation and Usage\n======================\n\nInstall molecule-inspec and pre-requisites:\n\n.. code-block::\n\n   pip install molecule molecule-inspec\n\nCreate a new role with molecule using the inspec verifier:\n\n.. code-block::\n\n   molecule init role \u003crole_name\u003e --verifier-name inspec\n\nConfigure ``\u003crole_name\u003e/molecule/default/tests/`` with the desired inspec\ntests. A simple default test is provided:\n\n.. code-block::\n\n   # frozen_string_literal: true\n\n   # Molecule managed\n\n   describe file('/etc/hosts') do\n   its('owner') { should eq 'root' }\n   its('group') { should eq 'root' }\n   its('mode') { should cmp '0644' }\n   end\n\nExecute `test` or `verify` on the role or scenario to run the Verify playbook\n\n.. code-block::\n\n   /inspec-role/molecule/default/molecule.yml.\n   INFO     default scenario test matrix: verify\n   INFO     Running default \u003e verify\n   INFO     Executing Inspec tests found in\n   /inspec-role/molecule/default/tests/...\n   INFO     Sanity checks: 'docker'\n\n   PLAY [Verify] ******************************************************************\n\n   TASK [Gathering Facts] *********************************************************\n   ok: [instance]\n\n   TASK [Setting variables (CentOS 7 / RHEL 7 / Amazon Linux 2)] ******************\n   ok: [instance]\n\n   TASK [Download Inspec] *********************************************************\n   changed: [instance]\n\n   TASK [Install Inspec (yum)] ****************************************************\n   changed: [instance]\n\n   TASK [Create inspec test directory] ********************************************\n   changed: [instance]\n\n   TASK [Copy inspec test directories] ********************************************\n   skipping: [instance] =\u003e (item={'root':\n   '/inspec-role/molecule/default/tests/', 'path': 'test_default.rb', 'state': 'file',\n   'src': '/inspec-role/molecule/default/tests/test_default.rb', 'uid': 501, 'gid': 20,\n   'owner': 'abtreece', 'group': 'staff', 'mode': '0644', 'size': 194,\n   'mtime': 1609387140.054121, 'ctime': 1609387140.054233})\n\n   TASK [Copy inspec test files] **************************************************\n   changed: [instance] =\u003e (item={'root':\n   '/inspec-role/molecule/default/tests/', 'path': 'test_default.rb', 'state': 'file',\n   'src': '/inspec-role/molecule/default/tests/test_default.rb', 'uid': 501, 'gid': 20,\n   'owner': 'abtreece', 'group': 'staff', 'mode': '0644', 'size': 194,\n   'mtime': 1609387140.054121, 'ctime': 1609387140.054233})\n\n   TASK [Execute Inspec tests] ****************************************************\n   changed: [instance]\n\n   TASK [Display details about the Inspec results] ********************************\n   ok: [instance] =\u003e {\n      \"msg\": [\n         \"\",\n         \"Profile: tests from /tmp/molecule/inspec (tests from .tmp.molecule.inspec)\",\n         \"Version: (not specified)\",\n         \"Target:  local://\",\n         \"\",\n         \"  File /etc/hosts\",\n         \"\\u001b[38;5;41m     ✔  owner should eq \\\"root\\\"\\u001b[0m\",\n         \"\\u001b[38;5;41m     ✔  group should eq \\\"root\\\"\\u001b[0m\",\n         \"\\u001b[38;5;41m     ✔  mode should cmp == \\\"0644\\\"\\u001b[0m\",\n         \"\",\n         \"Test Summary: \\u001b[38;5;41m3 successful\\u001b[0m, 0 failures, 0 skipped\"\n      ]\n   }\n\n   TASK [Fail when tests fail] ****************************************************\n   skipping: [instance]\n\n   PLAY RECAP *********************************************************************\n   instance: ok=8    changed=5    unreachable=0    failed=0    skipped=7    rescued=0\n   ignored=0\n\n   INFO     Verifier completed successfully.\n\n.. _get-involved:\n\nGet Involved\n============\n\n* Join us in the ``#ansible-molecule`` channel on `Freenode`_.\n* Join the discussion in `molecule-users Forum`_.\n* Join the community working group by checking the `wiki`_.\n* Want to know about releases, subscribe to `ansible-announce list`_.\n* For the full list of Ansible email Lists, IRC channels see the\n  `communication page`_.\n\n.. _`Freenode`: https://freenode.net\n.. _`molecule-users Forum`: https://groups.google.com/forum/#!forum/molecule-users\n.. _`wiki`: https://github.com/ansible/community/wiki/Molecule\n.. _`ansible-announce list`: https://groups.google.com/group/ansible-announce\n.. _`communication page`: https://docs.ansible.com/ansible/latest/community/communication.html\n\n.. _authors:\n\nAuthors\n=======\n\nMolecule Inspec Plugin was created by Sorin Sbarnea based on code from Molecule.\n\n.. _license:\n\nLicense\n=======\n\nThe `MIT`_ License.\n\n.. _`MIT`: https://github.com/ansible/molecule/blob/master/LICENSE\n\nThe logo is licensed under the `Creative Commons NoDerivatives 4.0 License`_.\n\nIf you have some other use in mind, contact us.\n\n.. _`Creative Commons NoDerivatives 4.0 License`: https://creativecommons.org/licenses/by-nd/4.0/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansible-community%2Fmolecule-inspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fansible-community%2Fmolecule-inspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansible-community%2Fmolecule-inspec/lists"}