Commit f9fd527
Changed files (2)
files/mirror-mirror.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=mirror-mirror service
+Documentation=https://github.com/ajpatri/mirror-mirror
+
+[Service]
+ExecStart=/opt/mirror-mirror/mirror-mirror
+Restart=on-failure
+RestartSec=5
+
+[Install]
+WantedBy=multi-user.target
main.yml
@@ -105,6 +105,7 @@
- src: "{{ home_repo }}/curlrc"
dest: "$HOME/.curlrc"
+ #TODO: mirror-mirror role
- name: nginx configs
copy:
src: "{{ item.src }}"
@@ -121,7 +122,51 @@
dest: "{{ nginx_sites}}/ip"
# TODO default landing page /var/www/html/index.html
notify: restart nginx
- tags: this
+
+ #TODO: mirror-mirror role
+ - name: optional software directories
+ file:
+ path: "{{ item }}"
+ state: directory
+ owner: ubuntu
+ group: ubuntu
+ mode: '0755'
+ become: True
+ loop:
+ - /opt/
+ - /opt/mirror-mirror/
+
+ #TODO: mirror-mirror role
+ - name: download software binaries
+ get_url:
+ url: "{{ item.url }}"
+ dest: "{{ item.dest }}"
+ mode: "{{ item.mode }}"
+ loop:
+ - url: https://github.com/ajpatri/mirror-mirror/releases/download/v0.1/mirror-mirror-v0.1-linux-amd64
+ dest: /opt/mirror-mirror/mirror-mirror
+ mode: '0755'
+
+ #TODO: mirror-mirror role
+ - name: mirror-mirror systemd service config
+ copy:
+ src: "files/mirror-mirror.service"
+ dest: "{{ systemd_path }}/mirror-mirror.service"
+ owner: root
+ group: root
+ become: True
+ vars:
+ systemd_path: "/etc/systemd/system"
+
+ #TODO: mirror-mirror role
+ - name: mirror-mirror systemd service start
+ systemd:
+ state: started
+ daemon_reload: True
+ name: mirror-mirror
+ become: True
+
+
handlers:
- name: restart nginx
@@ -135,7 +180,6 @@
#TODO
# sudo certbot --nginx --force-renewal --expand -d trustme.click -d www.trustme.click -d ip.trustme.click --agree-tos --no-eff-email --redirect -m admin@trustme.click
- # docker startup of mirror-mirror service
# wg genkey | sudo tee /etc/wireguard/tmc_privatekey | wg pubkey | sudo tee /etc/wireguard/tmc_publickey
# make 443 udp iptables forward to wireguard port