From b2b7449fc9c12152f05f4840f200be811a3b9b24 Mon Sep 17 00:00:00 2001 From: Anton Vakhrushev Date: Sun, 2 Apr 2023 22:02:06 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D1=83=D1=80=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D1=8E=20=D0=B4=D0=BB=D1=8F=20Nomie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 3 +++ ansible/configuration.yml | 22 ++++++++++++++++ ansible/templates/Caddyfile.j2 | 20 +++++++++++++-- ansible/vars/vars.yml | 46 ++++++++++++++++++---------------- 4 files changed, 68 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 8fa5240..0cfdb38 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,9 @@ configure-prod: configure-apps: $(MAKE) configure TAGS="webserver,apps,env" +configure-apps-in-prod: + $(MAKE) configure STAGE="prod" TAGS="webserver,apps,env" + configure-users: $(MAKE) configure TAGS="apps,env" diff --git a/ansible/configuration.yml b/ansible/configuration.yml index 10e2ced..949e5d9 100644 --- a/ansible/configuration.yml +++ b/ansible/configuration.yml @@ -7,6 +7,8 @@ homepage_port: "{{ base_port + 3 }}" netdata_port: "{{ base_port + 4 }}" wiki_port: "{{ base_port + 5 }}" + nomie_port: "{{ base_port + 6 }}" + nomie_db_port: "{{ base_port + 7 }}" vars_files: - vars/vars.yml @@ -126,3 +128,23 @@ WEB_SERVER_PORT: '127.0.0.1:{{ wiki_port }}' tags: - apps + + - import_role: + name: docker-app + vars: + username: nomie + extra_groups: + - docker + ssh_keys: + - '{{ lookup("file", "files/av_id_rsa.pub") }}' + env: + PROJECT_NAME: nomie + DOCKER_PREFIX: nomie + IMAGE_PREFIX: nomie + CONTAINER_PREFIX: nomie + WEB_SERVER_PORT: '127.0.0.1:{{ nomie_port }}' + COUCH_DB_PORT: '127.0.0.1:{{ nomie_db_port }}' + COUCH_DB_USER: 'couch-admin' + COUCH_DB_PASSWORD: '{{ nomie.couch_db_password }}' + tags: + - apps diff --git a/ansible/templates/Caddyfile.j2 b/ansible/templates/Caddyfile.j2 index 05e7788..40afb55 100644 --- a/ansible/templates/Caddyfile.j2 +++ b/ansible/templates/Caddyfile.j2 @@ -12,12 +12,12 @@ vakhrushev.me { # NetData proxy status.vakhrushev.me, :29999 { + tls anwinged@ya.ru + reverse_proxy { to 127.0.0.1:{{ netdata_port }} } - tls anwinged@ya.ru - basicauth / { {{ netdata.login }} {{ netdata.password_hash }} } @@ -30,3 +30,19 @@ wiki.vakhrushev.me { to 127.0.0.1:{{ wiki_port }} } } + +nomie.vakhrushev.me { + tls anwinged@ya.ru + + reverse_proxy { + to 127.0.0.1:{{ nomie_port }} + } +} + +nomie-db.vakhrushev.me { + tls anwinged@ya.ru + + reverse_proxy { + to 127.0.0.1:{{ nomie_db_port }} + } +} diff --git a/ansible/vars/vars.yml b/ansible/vars/vars.yml index 25e7a14..d75c062 100644 --- a/ansible/vars/vars.yml +++ b/ansible/vars/vars.yml @@ -1,22 +1,26 @@ $ANSIBLE_VAULT;1.1;AES256 -61643333376563373438636631326564663330626562633435616133633934623337333839353236 -6539383536656336356637633364626130363964653862660a393338363338353733613562623263 -31386464663433396639363162613264633361346464373130633236313939383138393437343234 -3963633030346331640a343031333032373364316365313865366531383334366161633438663735 -65353163346165353063316532623539643163353062373865356166306334636233396463643034 -38336663633133646439323362666266643030666333643963316334386136353063633237363361 -65303236626631313337623536353761633837646237653932323263393035336563383333646135 -63623161613639323361313566313531323934363234316266343165643936373766383431383865 -64653531383930653138313933643530653965616339313534346432656532666631323436313235 -31626331313962313236343264373864386466636333373935633537656639323263613636343236 -61656230633665653238353963653432626361373639666661303534343633353630323766613866 -34393835313037356631303432306137663631373535643863616663316565313739316336646264 -61363737306261633938336637383936643332633731333231653862653037663536633133383166 -37326536656339363934626230363065363132666137656334636635623534623637303232333739 -36613966653430336133656365363261383164626436623236653561623038376434316162653563 -64383232613365623365353135366334393830646330376137333732323239336231386238656464 -61393536663030623833633965316664383162653238343763393933333630303934666538626264 -36376437396561383037333064373039323834653264383732353466313162663437333530366163 -66613831643032376363326334393862383361326233353136383564366433346164343465653162 -39613836633663383166666232333064313865613961653932353831633763323132386532656166 -39623964396562343838653161393232663836663631393432373834373731646263 +64633761653833666663633233393164376238316564663434623333333738393637313836353831 +6165306432626631303432376563326631616262393964640a333936663761353763386563316337 +64646531343532393430663066336564353464393465386337656132363361396435363266666462 +3032346163626366300a353139386236386466383931356533366565613231363561653830653735 +36636661386636633533366332656536366636373366666633396538623030383339363462363531 +35666362303865343231613639343262373832393062366437633036393036613531643266356334 +30336163383130613933383333626131306666623534373866653530366664383138303131376534 +32666336643965323431643465633232656465313230346663653266313962643761303731326338 +32366566666463663165366538386236383039326433346632336263663566613362333639643439 +34363863653132333963643934313633626565333063333965623036646265393532666135346237 +62356239383937383362623135306531616134653036346664346437363335393061636539306233 +66653433333134623130613330643465313837303233303761383031373733353838393532626635 +38623632636237353932663834643962646663306563376333306235363137356131636537373864 +34343936633330383561373437613261623162303632333161316163343239303839323231366230 +62343938666566626538653765333138633865333637653135343361623532636562313035383639 +64316137656364356237303232616431333439353564626233393830393761646131356466353166 +30643634323563303734303765663835303864313237646238363134376565663765376664623066 +66616437393739633166306333313535623637323838363665393735646537666563333766626235 +62306264313238383033303633653061313137613331333737343333386634323661653765653337 +39386132306561663562643836323831363937613631303066313439353734373263393963316631 +65303462653035643465393862636532353330313037633264353863343837363361646634663732 +66313838643564346139363831366232616462633865343638636437323439316132363034663534 +62393664353066313361366430396166653435393539343530303237363562653834653230366337 +31643639343436366664663137623235613963636265623335383734326233323263336437313435 +6434