{"id":20331226,"url":"https://github.com/comcast/ansible-role-pypi","last_synced_at":"2026-02-24T01:04:01.138Z","repository":{"id":74042984,"uuid":"78218038","full_name":"Comcast/ansible-role-pypi","owner":"Comcast","description":"An ansible role for configuring a pypi-server on a systemd centos system.","archived":false,"fork":false,"pushed_at":"2017-09-23T14:03:09.000Z","size":18,"stargazers_count":8,"open_issues_count":1,"forks_count":2,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-11T21:07:58.892Z","etag":null,"topics":["ansible","molecule","python","testinfra","vagrant"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Comcast.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-06T15:51:46.000Z","updated_at":"2024-04-24T13:15:33.000Z","dependencies_parsed_at":"2023-03-11T16:25:46.478Z","dependency_job_id":null,"html_url":"https://github.com/Comcast/ansible-role-pypi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fansible-role-pypi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fansible-role-pypi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fansible-role-pypi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fansible-role-pypi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Comcast","download_url":"https://codeload.github.com/Comcast/ansible-role-pypi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480433,"owners_count":21110937,"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","python","testinfra","vagrant"],"created_at":"2024-11-14T20:19:19.675Z","updated_at":"2026-02-24T01:03:56.105Z","avatar_url":"https://github.com/Comcast.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"comcast.pypi\n============\n\nA role for provisioning a minimal pypi-server\n\nRole Variables\n--------------\n\n* `pypi_server_version`: 'The version of the pypiserver wheel to install and\n  use. Default: `1.2.0`.'\n* `pypi_user`: 'The user running the pypi-server service. It will be created if\n  it doesn't exist. Default: `pypi`.'\n* `pypi_group`: 'The group of which pypi_user is a member. Default: `pypi`.'\n* `pypi_server_port`: 'The port in which the pypi-server will listen on.\n  Default: `7974`.'\n* `pypi_home_dir`: 'The home directory of the pypi user. Default: `/srv/pypi`.'\n* `pypi_work_dir`: 'The workspace directory of the pypi-server. Default: `{{\n  pypi_home_dir }}`.'\n* `pypi_packages_directory`: 'The directory that will store uploaded python\n  packages. Default: `{{ pypi_work_dir }}/packages`.'\n* `pypi_log_file`: 'The log file the pypi-server will write to. Defautlt: `{{\n  pypi_work_dir }}/pypi-server.log`.'\n* `pypi_init_script_dir`: 'The directory that will store the pypi-server init\n  script (sys-v only). Default: `/etc/init.d`.'\n* `pypi_server_pid_file`: 'The location of the . Default: `{{ pypi_work_dir\n  }}/pypi.pid`.'\n* `pypi_requirements_template`: 'Template listing the required packages for\n  the pypi-server. Default: `templates/pypi-server-requirements.txt.j2`.'\n* `pypi_server_authenticate`: Comma-separated list of actions to authenticate\n  a client, ex.: `download,list,update`. Default: `update`.\n* `htaccess_dir`: 'The location of the generated `.htaccess` file. Default: `{{\n  pypi_home_dir }}`.'\n* `enable_anonymous_auth`: 'A boolean value that determines whether to use\n  username/password authentication for uploads to the pypi-server. Note:\n  Enabling this is not recommended as it will allow anyone to upload artifacts\n  to pypi. Default: `false`.'\n* `htaccess_username`: 'Username to use when authenticating to the pypi-server\n  (only used when `enable_anonymous_auth is false`). Default: `test`.'\n* `htaccess_password`: 'Password to use when authenticating to the pypi-server\n  (only used when `enable_anonymous_auth is false`). Default: `test`.'\n\nDependencies\n------------\n\nNone\n\nExample Playbook\n----------------\n\nIncluding an example of how to use your role (for instance, with variables\npassed in as parameters) is always nice for users too:\n\n```yaml\n    - hosts: servers\n      roles:\n         - role: comcast.pypi\n```\n\nTesting\n-------\n\nThe following tools are required for testing this role.\n\n1. [Virtualbox](https://www.virtualbox.org/wiki/Downloads)\n1. [Vagrant](https://www.vagrantup.com/downloads.html)\n1. [Python 2.7](https://www.python.org/downloads/release/python-2712/)\n1. [virtualenv](https://pypi.org/project/virtualenv/)\n\n\nCreate test environment:\n\n```bash\nvirtualenv --python=$(which python2.7) .venv\nsource .venv/bin/activate\npip install -r test-reqs.txt\n```\n\nRun tests:\n\n```bash\nmolecule test\n```\n\nTest against a specific platform:\n\n```bash\nmolecule test --platform centos/7\nmolecule test --platform debian/jessie64\n```\n\nTest uploads:\n\nAny python package can be used to test uploading. In this case BeautifulSoup4\nis used as an example.\n\n1. Stand up local pypi server\n\n```bash\nmolecule converge\n```\nThis should leave the pypi-server running on `http://localhost:8080` with 0\npackages stored.\n\n2. Clone a Python source repo\n\n```bash\ngit clone https://github.com/getanewsletter/BeautifulSoup4.git\n```\n\n3. Create/modify the `.pypirc` file in your home directory and add the\n`htaccess_username` and `htaccess_password` credentials if using authentication.\n\nThe `.pypirc` file should look similar to this:\n\n\u003e Note: If using the playbook defaults for the htaccess_username and\nhtaccess_password then the credentials should match what is in the playbook.yml\n\n```\n[distutils]\nindex-servers =\n  local\n\n[local]\nrepository: http://localhost:8080\nusername: \u003chtaccess_username\u003e\npassword: \u003chtaccess_password\u003e\n```\n4. Upload python package\n\nFrom the Python source code repo execute the following command.\n\n```bash\npython setup.py sdist upload -r local\n```\n\nThis should upload the python package to the pypi-server specified in the\n`.pypirc` file using the credentials specified in the `[local]` block.\n\n\nTest download:\n\nTo test package downloads from the local pypi-server the command below can be\nexecuted after successfully uploading a package. Following the upload example\nbeautifulsoup4 can be downloaded as follows:\n\n\u003e Change version_number for the example below to match the version of the\npackage that was uploaded.\n\n```bash\npip install --extra-index-url http://localhost:8080/ beautifulsoup4==\u003cversion_number\u003e\n```\n\nLicense\n-------\n\n[Apache 2.0](LICENSE)\n\nAuthor Information\n------------------\n\n* [Luis Ortiz][lortiz]\n* [Elliot Weiser][elliotweiser]\n* [Comcast][comcast]\n\n[comcast]: https://github.com/Comcast\n[elliotweiser]: https://github.com/elliotweiser\n[lortiz]: https://github.com/skippyPeanutButter\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomcast%2Fansible-role-pypi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomcast%2Fansible-role-pypi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomcast%2Fansible-role-pypi/lists"}