Skip to content
Snippets Groups Projects
Commit 9f556117 authored by Philipp Rothmann's avatar Philipp Rothmann
Browse files

add firmware-mirror

parent d8585eb3
No related branches found
No related tags found
1 merge request!39Firmware mirror
mirror_url: mirror01.luebeck.freifunk.net
\ No newline at end of file
......@@ -20,3 +20,11 @@ service_hosts:
hosts:
srv02:
ansible_ssh_host: srv02.luebeck.freifunk.net
firmware_mirrors:
vars:
ansible_python_interpreter: /usr/bin/env python3
ansible_ssh_user: root
hosts:
mirror01:
ansible_ssh_host: mirror01.luebeck.freifunk.net
......@@ -20,3 +20,9 @@
- services
- role: ffhl_ns_auth
tags: [nameserver, nsauth]
- hosts: firmware_mirrors
become: yes
roles:
- role: firmware_mirror
tags: [firmware_mirror]
[Unit]
Description=Firmware Mirror
[Service]
Type=oneshot
WorkingDirectory=/root/
ExecStart=/root/firmware-mirror.sh
[Install]
WantedBy=multi-user.target
[Unit]
Description=Firmware Mirror Timer
[Timer]
OnCalendar= *-*-* 03:42:23
[Install]
WantedBy=timers.target
\ No newline at end of file
#!/bin/sh
wget --no-clobber --recursive --reject-regex "/[debug|nightly]/*" firmware.ffhl.de
cp -r firmware.ffhl.de /var/www/firmware
chown -R www-data:www-data /var/www/firmware
\ No newline at end of file
- name: copy configs
copy:
src: etc/
dest: /etc
- name: install nginx
apt:
state: present
install_recommends: no
update_cache: yes
name:
- nginx-full
- libnginx-mod-http-fancyindex
- libnginx-mod-http-headers-more-filter
- name: copy nginx configs
template:
src: etc/nginx/sites-available/firmware
dest: /etc/nginx/sites-available/firmware
- name: enable sites
block:
- name: remove all enabled sites
file: state=absent path="/etc/nginx/sites-enabled/"
- name: create enabled-sites directory
file: state=directory path="/etc/nginx/sites-enabled"
- name: enable selected sites
file:
state: link
src: "../sites-available/firmware"
dest: "/etc/nginx/sites-enabled/firmware"
- name: enable nginx service
systemd:
name: nginx.service
state: restarted
enabled: yes
- name: copy mirror script
copy:
src: root/
dest: /root
mode: a+xr
- name: enable firmware-mirror timer
systemd:
name: firmware-mirror.timer
state: restarted
enabled: yes
\ No newline at end of file
server {
listen 80;
listen [::]:80;
server_name {{ mirror_url }};
client_max_body_size 5m;
client_body_timeout 60;
root /var/www/firmware;
location / {
index on;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment