So we wanted to create a repository for our configuration packages and reprepro seemed like a good and easy way to go. So I started making a script to the fabfile for installing and configuring it using this tutorial. I got the script done, tested it, and soon realised that it didn’t work. The distributions file was missing a line and the packages didn’t get added to the repository. So with the help of Armens I made some improvements to the script and got it working. Here’s our new working reprepro conf/distributions file:
Origin: Awase Codename: natty Label: Awase-All Suite: stable Version: 0.1 Architectures: i386 amd64 source Components: main non-free contrib Description: AwaseConfigurations
This distributions file and reprepro is installed to our webserver with our fabric task reprepro_setup() and the task gets run during our main() task.
Adding our configuration packages to the repository is done by first copying the package to our public_html directory and then adding it to the reprepro with this command:
reprepro includedeb natty package-name_0.1_all.deb
We do this with fabric using our add_to_repo() task which adds all of our packages to the repository.
Final task is to add our package repository to the package source list of each machine. It is done by adding a new source file to /etc/apt/sources.list.d/ and the source file should include this line:
deb http://host1.local/~ubuntu/ natty main
The new source can be added to our every machine with our fabric task add_reposource().
Now it’s possible to install our config packages to any of our machines simply with:
sudo apt-get install package-name
or with our fabric task:
All of these fabric tasks mentioned here can be found from our fabfile.