This playbook is used to initially deploy a mirror server. Currently there are roles for the following distributions available:
- Arch Linux
- CentOS
- Debian
- Debian Security
- Dotdeb
- EPEL
- openSUSE
- Ubuntu
To deploy the whole mirror setup, just execute the following commands:
$ echo "<server>" > /tmp/production.txt
$ ansible-playbook -i /tmp/production.txt site.yml -u root --ask-pass
If you just want to deploy a single part of the mirror, you have to create a new playbook. For example:
---
# file: mymirror.yml
- hosts: all
roles:
- common
- goaccess
- archlinux
And use it like site.yml
$ echo "<server>" > /tmp/mymirror.txt
$ ansible-playbook -i /tmp/mymirror.txt mymirror.yml -u root --ask-pass
As of Ansible 1.7, there was no blockinfile available.
We decided to manually edit the file /etc/nginx/conf.d/mirror-locations
so we have full control over the mirrors we expose.
You can add configuration pieces like the following to expose the mirror:
location /opensuse {
alias /var/www/mirror/opensuse;
autoindex on;
}
GNU GENERAL PUBLIC LICENSE Version 3