diff --git a/host-pottwal.yml b/host-pottwal.yml index 83bc77a..846a4b2 100644 --- a/host-pottwal.yml +++ b/host-pottwal.yml @@ -98,14 +98,42 @@ env: TZ: "{{ timezone }}" + - name: Setup docker network + docker_network: + name: shlinknet + state: present + internal: true + tags: + - shlink + - name: Ensure shlink data dir exists ansible.builtin.file: - path: "{{ data_dir }}/shlink" + path: "{{ data_dir }}/shlink/data/database" state: directory mode: 0755 tags: - shlink + - name: Ensure shlink database container is running + docker_container: + name: shlinkdb + image: postgres:16.1-alpine + pull: true + state: started + restart_policy: unless-stopped + detach: yes + env: + TZ: "{{ timezone }}" + POSTGRES_USER: "shlink" + POSTGRES_PASSWORD: "{{ shlink_postgres_password }}" + POSTGRES_DB: "shlink" + volumes: + - "{{ data_dir }}/shlink/data/database:/var/lib/postgresql/data" + networks: + - name: shlinknet + tags: + - shlink + - name: Ensure container for shlink is running docker_container: name: shlink @@ -121,8 +149,18 @@ DEFAULT_DOMAIN: "{{ shlink_domain_name }}" GEOLITE_LICENSE_KEY: "{{ shlink_geolite_license_key }}" INITIAL_API_KEY: "{{ shlink_initial_api_key }}" + DB_DRIVER: "postgres" + DB_HOST: shlinkdb + DB_NAME: "shlink" + DB_USER: "shlink" + DB_PASSWORD: "{{ shlink_postgres_password }}" volumes: - "{{ data_dir }}/shlink/database.sqlite:/etc/shlink/datadatabase.sqlite:rw" + networks_cli_compatible: false + comparisons: + networks: allow_more_present + networks: + - name: shlinknet tags: - shlink diff --git a/host_vars/pottwal.n39.eu/vars.yml b/host_vars/pottwal.n39.eu/vars.yml index 07fbc86..33dde46 100644 --- a/host_vars/pottwal.n39.eu/vars.yml +++ b/host_vars/pottwal.n39.eu/vars.yml @@ -19,6 +19,7 @@ shlink_domain_name: sl.n39.eu shlink_image: shlinkio/shlink:3.7.0 shlink_geolite_license_key: "{{ vault_shlink_geolite_license_key }}" shlink_initial_api_key: "{{ vault_shlink_initial_api_key }}" +shlink_postgres_password: "{{ vault_shlink_postgres_password }}" hedgedoc_host_port: 8084 hedgedoc_domain_name: pad.n39.eu diff --git a/host_vars/pottwal.n39.eu/vault b/host_vars/pottwal.n39.eu/vault index 9abc0b9..d923c07 100644 --- a/host_vars/pottwal.n39.eu/vault +++ b/host_vars/pottwal.n39.eu/vault @@ -1,33 +1,35 @@ $ANSIBLE_VAULT;1.1;AES256 -34373163393834623634633434373737303738383439616433633236363937633764666231373964 -6330396333366432343765313738396461333133656236350a356239656636363764303464323737 -32353330336364663833386631303364323861326664633937383132373735373337393431646633 -3763323461363561390a393034333364663633396462646632393362613733363239633061616139 -30383461363565346464306263613363396237373233346361333137626539613463336665343134 -66623461623634386134636334386561356230373138643039653335353866356630646536376438 -33643232313037356261303034383232623863323030616134386530646366636230616432316639 -33346637316435353365343434613230353934613262653964643563303938326433373938636539 -30643633636134666135393166313334353336343132346564313637333837323036623331326134 -32643166663165343739663936356432633739303265333536336365646435313162623638353434 -30613335306134623238666261666537366631633133663162346464396138383139613331346436 -34363232356163373534393062303137663732366237313732323465613463323837386561666164 -37346535393263343661303436353739323364323663626135373330303038383135653564623734 -62383337666362653633323130613264303133653731643965666461383030656562373832333731 -36333632353763363931326235613164646364306162643533353038613239386632336662346532 -38626135323233386462646533633536396235396465643635383834306631613234646336656134 -64616530346466666231623432323462623438643333373838396666356465386230383737663731 -35356262613064366433363263373033636632363135386531616636313337663536643437623061 -66353333376530663765376432323933363730646237646535663533346333633263346563343337 -61313461323966393536303961623037353432326632336132306134343332663462666230353732 -65613832633134386266373337396439333637343139626136636237383632366232363837383539 -37353965323061336365653366343064653739346363623662373734323065323162353035363938 -62326664306232356134306563646338666635333531663338396239636539356664333937663636 -36303032333962653335326261366362373035626463303933393666633832393762326435386361 -36353065363762363638303833616133663330393532313233306135653034656562626435633834 -62383833306633346662383439313037633763353737333234373234303962666262316638326461 -62373765643432663134643561623261326265306437306439353966336364373931376261333963 -65353938376463313463623037303566366435323938326633353334323731333134353137356165 -39346563303536356565663333393061613231653565646435373839626235633032316333646566 -37303232396139653531633836663461623464316332666632363435313566326262666562626130 -63613937323335336630383261363334396366623161343730623662363533323430326334353063 -31343938346434613765 +33383365663237393662386363396661323463396239653830396164316538323362376337326233 +3730346439376362396261333165616536616135366637660a323435346262353061323130303362 +66656533633333346536653638303463386334306461313830383631323331343332376435636631 +6662323136306538370a616563376364373737396134616161356134636663613262366234306530 +36396635383933393034613863386338613266333834616666393939393261613235366132663866 +65356162633934633066336532396662356163386335313833386230643165633464663065383131 +32366534366335623136363738653066336339623832636166343239613535623333343035633662 +39663638386364306361643861666530323730626265633865343534643564363961636463356431 +34333463383137363064323634656561313464303266653138383038303964363263326165643130 +63613162383030323263613964303932623339626139326161393439663763386462313562636330 +65323762356135333736316564623565316533646132303265623364386263383733306136326237 +36353638663936666633393332623436643436333164633566386130396638633637323538633033 +37326663636139646236636164353066626136396566633363333236313266656139646563386234 +66633735396532613838646561643563623538363264383763303363313266363134353232643666 +33333531386238356232306164346331353366636565656463323134333362353764663437663330 +63363065353430353861316134656533363533666335373163303661656134646237386664636564 +33643836386331363461383934666335336533353331363735346566323139646362343765383766 +38306462313033353831626439626235393036393765306139313161353163636233616139396430 +65373236336562343939356266333037643838363333396462336331303366333362393462313233 +61343632646431616461343861626437623362343762393265323461343263396338373434623065 +63316438323732326531316534613531366464623435623163663830343962343532353136366338 +36646663363763633432376632353164366463336166356465333238383637623633663039343938 +31613662666336316137376338393131393331653331663465373266313164303962363932656430 +63623733313362323166356435346634333431306431393633346430336461663965643362643634 +37666635633937323635373837333034653835363939623938306462366234343130386430303965 +39323563343033343137363065396134366434383637363661323538343135323336333962646131 +36356436396431646566613133336263653466633237373839626361393738383865313238363535 +66623031623562386634366238383632326238636231626637633436326336633335626433653363 +36626237333962653863613932376230396535303834323030353239623161653734303966633930 +38653338636431383730376262386630613062366231366239616233616439386531313338343166 +38656138303363643933633864616366343039626237616633643961346338623737313266633537 +36623731323639643530363766323530616462366264613265303861663863306461393834393565 +38656535353138306264386433323337343661326435316632323838303639353830613832613461 +6461613532393237393866613765396530633561663838613461