{"id":18803919,"url":"https://github.com/ganto/ansible-copr_reposync","last_synced_at":"2025-04-13T18:34:41.603Z","repository":{"id":40382107,"uuid":"242394689","full_name":"ganto/ansible-copr_reposync","owner":"ganto","description":"Ansible role to setup COPR repository mirror","archived":false,"fork":false,"pushed_at":"2025-02-05T06:49:38.000Z","size":112,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T09:13:04.859Z","etag":null,"topics":["ansible-role","copr","reposync"],"latest_commit_sha":null,"homepage":"","language":"Jinja","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/ganto.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-02-22T18:53:13.000Z","updated_at":"2025-02-05T06:45:46.000Z","dependencies_parsed_at":"2024-11-24T13:17:21.944Z","dependency_job_id":"fba6558c-6c31-48fc-bb4d-d4f33a499ff0","html_url":"https://github.com/ganto/ansible-copr_reposync","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/ganto%2Fansible-copr_reposync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganto%2Fansible-copr_reposync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganto%2Fansible-copr_reposync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganto%2Fansible-copr_reposync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ganto","download_url":"https://codeload.github.com/ganto/ansible-copr_reposync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248761128,"owners_count":21157497,"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-role","copr","reposync"],"created_at":"2024-11-07T22:37:25.373Z","updated_at":"2025-04-13T18:34:41.597Z","avatar_url":"https://github.com/ganto.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible Role: ganto.copr_reposync\n\n[![CI](https://github.com/ganto/ansible-copr_reposync/actions/workflows/ci.yml/badge.svg)](https://github.com/ganto/ansible-copr_reposync/actions/workflows/ci.yml)\n[![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-ganto.copr__reposync-blue.svg?style=flat\u0026logo=ansible)](https://galaxy.ansible.com/ganto/copr_reposync)\n\nSetup a local package mirror of a [COPR](https://copr.fedorainfracloud.org/coprs/) repository which is able to provide packages that will be deleted by COPR over time. It can then be served to other machines with Web server.\n\nA synchronization job will be created as a 'oneshot' systemd service which can be executed through a (optional) systemd timer.\n\n## Requirements\n\nThis role must run on a Linux host that uses systemd and has the `dnf-utils` and `createrepo_c` packages available which is typically Fedora or CentOS 8.\n\n## Getting Started\n\n1. Download this role via:\n\n   ```\n   $ ansible-galaxy install ganto.copr_reposync\n   ```\n\n1. Create a minimal playbook (e.g. called `reposync.yml`) to run this role:\n\n   ```YAML\n   - name: Setup COPR repository mirror\n     hosts: localhost\n     become: True\n     gather_facts: False\n\n     vars_prompt:\n       - name: 'copr_reposync_name'\n         prompt: 'Enter COPR repository name (e.g. ganto/jo)'\n         private: no\n\n     roles:\n       - name: ganto.copr_reposync\n   ```\n\n1. Run this role (for example against the [ganto/jo](https://copr.fedorainfracloud.org/coprs/ganto/jo/) repository):\n\n   ```\n   $ ansible-playbook reposync.yml\n   Enter COPR repository name (e.g. ganto/jo): ganto/jo\n\n   PLAY [Setup COPR repository mirror] ************************\n   ...\n   ```\n\nAfter playbook execution completed there will be a directory `/var/www/html/ganto/jo` that includes the package repositories for the most common distributions and releases e.g. `epel-7-x86_64` with all RPMs that are part of this repository including newly generated repository metadata so that this folder than be easily used as a yum/dnf repository by itself.\n\nThere is also a systemd timer that will regularly synchronize new package builds from COPR and regenerate the repository metadata.\n\n```\n$ sudo systemctl list-timers\nNEXT                         LEFT          LAST                         PASSED      UNIT                               ACTIVATES\nSun 2020-02-23 06:00:00 UTC  5h 31min left Sun 2020-02-23 00:00:07 UTC  28min ago   reposync@jo-epel-7-x86_64.timer    reposync@jo-epel-7-x86_64.service\nSun 2020-02-23 06:00:00 UTC  5h 31min left Sun 2020-02-23 00:00:07 UTC  28min ago   reposync@jo-epel-8-x86_64.timer    reposync@jo-epel-8-x86_64.service\nSun 2020-02-23 06:00:00 UTC  5h 31min left Sun 2020-02-23 00:00:07 UTC  28min ago   reposync@jo-fedora-30-x86_64.timer reposync@jo-fedora-30-x86_64.service\nSun 2020-02-23 06:00:00 UTC  5h 31min left Sun 2020-02-23 00:00:07 UTC  28min ago   reposync@jo-fedora-31-x86_64.timer reposync@jo-fedora-31-x86_64.service\n```\n\n**Serving the COPR repository mirror**\n\n1. Install and start a Web server. E.g.:\n\n   ```\n   $ sudo dnf install httpd\n   $ sudo systemctl enable --run httpd\n   ```\n\n1. Download the repository file for your distribution. E.g.:\n\n   ```\n   $ sudo wget -O /etc/yum.repos.d/_copr-mirror_ganto-jo.repo http://localhost/ganto/jo/ganto-jo-fedora.repo\n   ```\n\n1. Now you can install every package version from the synchronized repository mirror:\n\n   ```\n   $ sudo dnf install jo-1.3\n   ```\n\n## Development\n\n### Testing\n\nThere is a [Molecule](https://molecule.readthedocs.io/) test profile that can be used to verify the basic functionality of the role. The default scenario is\nusing the [podman](https://podman.io/) container driver. If you prefer [docker](https://www.docker.com/) you can select the corresponding scenario with the `-s docker` molecule arguments.\n\n1. Ensure you have the necessary dependencies installed (e.g. in a Python [venv](https://docs.python.org/3/tutorial/venv.html)):\n\n```\npip install -r molecule/podman/requirements.txt         # for podman\n# or\npip install -r molecule/docker/requirements.txt         # for docker\n```\n\n2. Run the test suite. When using docker, then you need to add the `-s docker` option. The options in brackets are optional but useful if you need to troubleshoot issues:\n\n```\nmolecule [-vvv] test [--destroy never][-s docker]\n```\n\n3. If you used `--destroy never` the container will remain after the test run and can be inspected interactively via:\n\n```\npodman exec -it \u003ccontainer-id\u003e /bin/sh                  # for podman\n# or\ndocker exec -it \u003ccontainer-id\u003e /bin/sh                  # for docker\n```\n\n4. Once you're done with inspecting the instance it has to be deleted before a new test run can be started:\n\n```\nmolecule destroy [-s docker]\n```\n\n## License\n\n[Apache-2.0](https://spdx.org/licenses/Apache-2.0.html)\n\n## Author Information\n\n[Changelog](CHANGELOG.md)\n\nThe [ganto.copr_reposync](https://galaxy.ansible.com/ganto/copr_reposync) role was written and is maintained by:\n\n- [Reto Gantenbein](https://linuxmonk.ch/) | [e-mail](mailto:reto.gantenbein@linuxmonk.ch) | [GitHub](https://github.com/ganto)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fganto%2Fansible-copr_reposync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fganto%2Fansible-copr_reposync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fganto%2Fansible-copr_reposync/lists"}