What is repositor.io?

repositor.io is a tool to create and manage linux repositories. You can mirror online repositories so that you don't need to download the package every time you set up a new server. You can also secure your servers behind a firewall and disable outgoing http traffic.

With repositor.io it is easy to create custom repositories for your own packages. With the integration of a configuration management tool you can create consistant installations of your server.

Getting Started

Getting started with repositor.io is easy! Just open a terminal as root and run this command:

$ wget -O - http://get.repositor.io/ | bash

This will add the EPEL package repository to your package manager (on CentOS and RedHat) and install the application.

Using repositor.io to mirror a repository

First you have to create a configuration file. The installation already has created an example file for you in /etc/rex/repositorio.conf. Just open the file in an editor and add the repositories you want to mirror.

Currently repositor.io supports Yum and Apt mirrors. If you want to contribute please visit our Github repository.

Now you can run the mirror command to start the mirror process:

$ repositorio --mirror --repo=repository-name

repositorio will download the repository into the head branch. If you want to create a tag of a tested state you can do this with the tag command:

$ repositorio --repo=repository-name --tag=production

Using repositor.io to create a custom repository

First you have to edit your configuration file and add a new repository.

<Repository custom-repo>
  local = custom-repo/custom/6/x86_64/
  type  = Yum
</Repository>

If you want to create an Apt repository instead the configuration looks a bit different.

# line in sources.list:
# deb http://your-server.corp/custom-repo/debian wheezy custom
<Repository custom-repo>
  local     = custom-repo/debian
  type      = Apt
  arch      = amd64
  dist      = wheezy
  component = custom
</Repository>

After adding your repository to the configuration file you can just initialize the new repository.

For the Yum repository type you need to have createrepo installed on your system. For Apt you need apt-ftparchive.

$ repositorio --repo=custom-repo --init

Now you can add files to your new repository with the add-file command:

$ repositorio --repo=custom-repo --add-file=my-custom-package-1.0.rpm

Using Repositor.io with a configuration management tool

Here we will show you how to integration repositor.io with Rex. Rex is a simple configuration management tool based on SSH and Perl. So you don't need to install an agent on you servers. You just need an SSH account. To install Rex please see the installation instructions on the website.

First we will create a new Rex project.

$ rexify PackageManagement

Now you can open the Rexfile, add your servers, add a task to configure your new repository and a task to update your packages.

use Rex -base;

user "root";

group myservers => "server1", "server2", "server3";

task "prepare", group => "myservers", make {
  repository
    add => "custom-repo",
    url => "http://repo-server.corp/production/custom-repo/custom/6/x86_64";
};

task "update_system", group => "myserver", make {
  update_package_db;
  update_system;
};

Save the file, and now you can add your custom repository to your systems and update them with one command:

$ rex prepare update_system
Fork me on GitHub