Deploy yourls
This commit is contained in:
parent
2a8f715eca
commit
0ecd884a9a
7 changed files with 90 additions and 0 deletions
|
@ -50,6 +50,7 @@
|
|||
- heimdall
|
||||
- gitea
|
||||
- duplicati
|
||||
- yourls
|
||||
|
||||
- hosts: walker
|
||||
roles:
|
||||
|
|
32
ansible/roles/yourls/files/docker-compose.yml
Normal file
32
ansible/roles/yourls/files/docker-compose.yml
Normal file
|
@ -0,0 +1,32 @@
|
|||
version: "2.3"
|
||||
|
||||
services:
|
||||
yourls:
|
||||
image: yourls:1.7.9-apache
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- mariadb
|
||||
environment:
|
||||
- YOURLS_DB_PASS=yourls
|
||||
- YOURLS_DB_USER=yourls
|
||||
- YOURLS_DB_HOST=mariadb
|
||||
- YOURLS_USER=jake
|
||||
- YOURLS_PASS={{ yourls_password }}
|
||||
- YOURLS_SITE=https://0rng.one
|
||||
volumes:
|
||||
- ./index.html:/var/www/html/index.html
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.yourls.rule=Host(`0rng.one`)
|
||||
- traefik.http.routers.yourls.tls.certresolver=le
|
||||
|
||||
mariadb:
|
||||
image: mariadb:10.5
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=root
|
||||
- MYSQL_DATABASE=yourls
|
||||
- MYSQL_USER=yourls
|
||||
- MYSQL_PASSWORD=yourls
|
||||
volumes:
|
||||
- ./mariadb:/var/lib/mysql
|
||||
restart: unless-stopped
|
8
ansible/roles/yourls/files/index.html
Normal file
8
ansible/roles/yourls/files/index.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0; url=//theorangeone.net" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>Redirecting to website...</h1>
|
||||
</body>
|
||||
</html>
|
4
ansible/roles/yourls/handlers/main.yml
Normal file
4
ansible/roles/yourls/handlers/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
- name: restart yourls
|
||||
shell:
|
||||
chdir: /opt/yourls
|
||||
cmd: "{{ docker_update_command }}"
|
26
ansible/roles/yourls/tasks/main.yml
Normal file
26
ansible/roles/yourls/tasks/main.yml
Normal file
|
@ -0,0 +1,26 @@
|
|||
- name: Create install directory
|
||||
file:
|
||||
path: /opt/yourls
|
||||
state: directory
|
||||
owner: "{{ docker_user.name }}"
|
||||
mode: "{{ docker_compose_directory_mask }}"
|
||||
become: true
|
||||
|
||||
- name: Install compose file
|
||||
template:
|
||||
src: files/docker-compose.yml
|
||||
dest: /opt/yourls/docker-compose.yml
|
||||
mode: "{{ docker_compose_file_mask }}"
|
||||
owner: "{{ docker_user.name }}"
|
||||
validate: /usr/bin/docker-compose -f %s config
|
||||
notify: restart yourls
|
||||
become: true
|
||||
|
||||
- name: Install redirect file
|
||||
template:
|
||||
src: files/index.html
|
||||
dest: /opt/yourls/index.html
|
||||
mode: "{{ docker_compose_file_mask }}"
|
||||
owner: "{{ docker_user.name }}"
|
||||
notify: restart yourls
|
||||
become: true
|
11
ansible/roles/yourls/vars/main.yml
Normal file
11
ansible/roles/yourls/vars/main.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
yourls_password: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
33643039353165363833306237306638636438623138343263666562356638333539376166363366
|
||||
3861353462663436303638636562313236303238346235390a333438303537313966656337306138
|
||||
36636530613837333631323135356334343639653761656132333531616230326332663366663865
|
||||
3730363965303264620a663566353232363364613264636534343462323239633938343033366133
|
||||
38313162626432393732383635623364343934303234323935353130373566343436323437636334
|
||||
61383663653636373931326437636262306639616335613865366630313537613333393337353639
|
||||
34613464323964633265363534323435353834333539323763623537373064303439353566373266
|
||||
31636336663734326530623434633334663962663634653861383465343861316463386136373936
|
||||
62393662343637313239396462643938393132366536666638623266376566616639
|
|
@ -33,3 +33,11 @@ resource "cloudflare_record" "orngone_dl" {
|
|||
type = "A"
|
||||
ttl = 1
|
||||
}
|
||||
|
||||
resource "cloudflare_record" "orngone_yourls" {
|
||||
zone_id = cloudflare_zone.orngone.id
|
||||
name = "@"
|
||||
value = vultr_server.casey.main_ip
|
||||
type = "A"
|
||||
ttl = 1
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue