testing up1 and goploader
This commit is contained in:
parent
e326a2026b
commit
119a3e4591
11 changed files with 82 additions and 8 deletions
10
goploader.yml
Normal file
10
goploader.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: "Testing goploader role"
|
||||||
|
hosts: localhost
|
||||||
|
become: true
|
||||||
|
roles:
|
||||||
|
- role: common
|
||||||
|
- role: goploader
|
||||||
|
vars:
|
||||||
|
hostname: :8000
|
2
roles/goploader/defaults/main.yml
Normal file
2
roles/goploader/defaults/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
---
|
||||||
|
hostname: :8000
|
5
roles/goploader/handlers/main.yml
Normal file
5
roles/goploader/handlers/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
- name: Restart goploader
|
||||||
|
service:
|
||||||
|
name: goploader
|
||||||
|
state: restarted
|
7
roles/goploader/meta/main.yml
Normal file
7
roles/goploader/meta/main.yml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
dependencies:
|
||||||
|
- role: caddy
|
||||||
|
vars:
|
||||||
|
caddy_config: |
|
||||||
|
{{ hostname }}
|
||||||
|
reverse_proxy / 127.0.0.1:8008
|
36
roles/goploader/tasks/main.yml
Normal file
36
roles/goploader/tasks/main.yml
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: ensure goploader user is present
|
||||||
|
user:
|
||||||
|
name: "goploader"
|
||||||
|
home: "/srv/goploader"
|
||||||
|
shell: "/bin/bash"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Download Goploader
|
||||||
|
get_url:
|
||||||
|
url: https://gpldr.in/releases/servers/server_amd64.tar.gz
|
||||||
|
dest: /srv/goploader/server.tgz
|
||||||
|
become: true
|
||||||
|
become_user: goploader
|
||||||
|
|
||||||
|
- name: Unarchive goploader
|
||||||
|
unarchive:
|
||||||
|
src: /srv/goploader/server.tgz
|
||||||
|
dest: /srv/goploader
|
||||||
|
owner: goploader
|
||||||
|
group: goploader
|
||||||
|
|
||||||
|
|
||||||
|
- name: Template systemd service
|
||||||
|
template:
|
||||||
|
src: goploader.service
|
||||||
|
dest: /etc/systemd/system/goploader.service
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
||||||
|
notify:
|
||||||
|
- Restart goploader
|
||||||
|
|
||||||
|
|
||||||
|
|
11
roles/goploader/templates/goploader.service
Normal file
11
roles/goploader/templates/goploader.service
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
[Unit]
|
||||||
|
Description=goploader
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=goploader
|
||||||
|
WorkingDirectory=/srv/goploader/goploader-server
|
||||||
|
ExecStart=/srv/goploader/goploader-server/server
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -1,5 +1,4 @@
|
||||||
---
|
---
|
||||||
api_key: "{{lookup('password', './.pass/up1_api_key')}}"
|
api_key: "{{lookup('password', './.pass/up1_api_key')}}"
|
||||||
maximum_file_size: 500000000
|
maximum_file_size: 500000000
|
||||||
port: 31337
|
|
||||||
footer: <a href="https://github.com/Upload/Up1" target="_blank">Source Code</a> - <a href="mailto:info@cisti.org" id="contact" target="_blank">Contact</a>
|
footer: <a href="https://github.com/Upload/Up1" target="_blank">Source Code</a> - <a href="mailto:info@cisti.org" id="contact" target="_blank">Contact</a>
|
||||||
|
|
4
roles/up1/main.yml
Normal file
4
roles/up1/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
api_key: "{{lookup('password', './.pass/up1_api_key')}}"
|
||||||
|
maximum_file_site: 500000000
|
||||||
|
footer: "<a href="https://github.com/Upload/Up1" target="_blank">Source Code</a> - <a href="mailto:info@cisti.org" id="contact" target="_blank">Contact</a>"
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: ensure lufi user is present
|
- name: ensure up1 user is present
|
||||||
user:
|
user:
|
||||||
name: "up1"
|
name: "up1"
|
||||||
home: "/srv/up1"
|
home: "/srv/up1"
|
||||||
|
@ -19,16 +19,16 @@
|
||||||
src: server.conf.j2
|
src: server.conf.j2
|
||||||
dest: /srv/up1/up1/server/server.conf
|
dest: /srv/up1/up1/server/server.conf
|
||||||
owner: up1
|
owner: up1
|
||||||
group: up1
|
group: www-data
|
||||||
mode: 0600
|
mode: 0660
|
||||||
|
|
||||||
- name: copy client settings
|
- name: copy client settings
|
||||||
template:
|
template:
|
||||||
src: config.js.j2
|
src: config.js.j2
|
||||||
dest: /srv/up1/up1/client/config.js
|
dest: /srv/up1/up1/client/config.js
|
||||||
owner: up1
|
owner: up1
|
||||||
group: up1
|
group: www-data
|
||||||
mode: 0600
|
mode: 0660
|
||||||
|
|
||||||
- name: Install up1 deps
|
- name: Install up1 deps
|
||||||
become: true
|
become: true
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
"http": {
|
"http": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"listen": "127.0.0.1:{{ port }}"
|
"listen": "127.0.0.1:31337"
|
||||||
},
|
},
|
||||||
|
|
||||||
"https": {
|
"https": {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: "Testing up1 role"
|
- name: "Testing up1 role"
|
||||||
hosts: localhost
|
hosts: jolly
|
||||||
become: true
|
become: true
|
||||||
roles:
|
roles:
|
||||||
- role: common
|
- role: common
|
||||||
|
|
Loading…
Reference in a new issue