diff --git a/ansible/main.yml b/ansible/main.yml index 5e4c568..a571fa0 100644 --- a/ansible/main.yml +++ b/ansible/main.yml @@ -44,3 +44,7 @@ - statping - socks-proxy - upload + +- hosts: walker + roles: + - contessa diff --git a/ansible/roles/contessa/files/docker-compose.yml b/ansible/roles/contessa/files/docker-compose.yml new file mode 100644 index 0000000..e0ed40d --- /dev/null +++ b/ansible/roles/contessa/files/docker-compose.yml @@ -0,0 +1,16 @@ +version: "2.3" + +services: + contessa: + image: minio/minio:latest + restart: unless-stopped + volumes: + - /mnt/tank/contessa:/data + command: server /data --quiet + environment: + - MINIO_ACCESS_KEY={{ minio_access_key }} + - MINIO_SECRET_KEY={{ minio_secret_key }} + labels: + - traefik.enable=true + - traefik.http.routers.contessa.rule=Host(`contessa.jakehoward.tech`) + - traefik.http.routers.contessa.tls.certresolver=le diff --git a/ansible/roles/contessa/handlers/main.yml b/ansible/roles/contessa/handlers/main.yml new file mode 100644 index 0000000..8ede262 --- /dev/null +++ b/ansible/roles/contessa/handlers/main.yml @@ -0,0 +1,4 @@ +- name: restart contessa + shell: + chdir: /opt/contessa + cmd: "{{ docker_update_command }}" diff --git a/ansible/roles/contessa/tasks/main.yml b/ansible/roles/contessa/tasks/main.yml new file mode 100644 index 0000000..1bdb350 --- /dev/null +++ b/ansible/roles/contessa/tasks/main.yml @@ -0,0 +1,20 @@ +- name: Include variables + include_vars: main.yml + +- name: Create install directory + file: + path: /opt/contessa + 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/contessa/docker-compose.yml + mode: "{{ docker_compose_file_mask }}" + owner: "{{ docker_user.name }}" + validate: /usr/bin/docker-compose -f %s config + notify: restart contessa + become: true diff --git a/ansible/roles/contessa/vars/main.yml b/ansible/roles/contessa/vars/main.yml new file mode 100644 index 0000000..225a4c4 --- /dev/null +++ b/ansible/roles/contessa/vars/main.yml @@ -0,0 +1,22 @@ +minio_access_key: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 37383434623164656163396634653735393265613566353131316461666136656433363066633332 + 6338626439363939316561353938383237623930323561660a353836636363633065396434313339 + 63653937636133653534313832303565643162333263373435316438303438393165326365326531 + 3162363432383261330a653163643939383137653030633736346533343536386166623030336361 + 61636366626235316138383236393061333130303138353066663563656331343437373764623961 + 37626666393736396166323439363066313936306464613837366161353739613430313632633036 + 61666566333432343161366163656538343063353531656265323535353836303536613562646335 + 36613735326130306666343038313237373935316666653733393936356131663333393232613331 + 36393430383239386631656663663162333134386537306562386435353964646366 +minio_secret_key: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 30663437356366323237336531303938653830303761383136613234393639663534656361393462 + 6230666430633230613436333363633364373464376261640a343035386437376539376637646331 + 39636635396330333731646231653838616336643764336465303130336461643265396634633261 + 3333373431653832380a613631353331323239373464653034626264353035313736356165656430 + 66376163653635373236383631383439383533343563393136636262343263393561356539646437 + 38626137643538646265376362383561396233663165373834633138376633353034616138656631 + 33333936653730383431323632383433303139333636666535343534373964336636386566353432 + 63393262643563316561373336313661326333626134666237366235303663366433646139313734 + 62663932396337343630613335656537373339343239636362616138623232353031 diff --git a/terraform/jakehoward.tech.tf b/terraform/jakehoward.tech.tf index aefa593..5049783 100644 --- a/terraform/jakehoward.tech.tf +++ b/terraform/jakehoward.tech.tf @@ -139,3 +139,11 @@ resource "cloudflare_record" "jakehowardtech_homeassistant" { type = "A" ttl = 1 } + +resource "cloudflare_record" "jakehowardtech_contessa" { + zone_id = cloudflare_zone.jakehowardtech.id + name = "contessa" + value = "5.39.79.153" + type = "A" + ttl = 1 +}