Skip to content

Commit

Permalink
refact: alterando forma de obter env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
gomex committed Sep 27, 2021
1 parent 4a6ce7e commit 8e9816c
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 53 deletions.
37 changes: 22 additions & 15 deletions group_vars/production/vars.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
---
# file: group_vars/production/vars.yml
env: "production"
task_name: "production environment configuration"
app: "dadosabertosdefeira.com.br"
app: "mq.dadosabertosdefeira.com.br"
# specify a email for dokku-letsencrypt
dokku_letsencrypt_email: "linux.rafa@gmail.com"
# specify port so `domains` can setup the port mapping properly
port: "5000"
database_url: "{{ vault_database_url }}"
cloudamqp_url: "{{ vault_cloudamqp_url }}"
cloudamqp_apikey: "{{ vault_cloudamqp_apikey }}"
city_council_webservice: "https://www.transparencia.feiradesantana.ba.leg.br/"
django_allowed_hosts: ".dadosabertosdefeira.com.br"
django_configuration: "Prod"
django_secret_key: "{{ vault_django_secret_key }}"
django_settings_module: "web.settings"
enable_autothrottle_debug: "true"
new_relic_log: "stdout"

apps_config:
DOKKU_LETSENCRYPT_EMAIL: "linux.rafa@gmail.com"
PORT: "5000"
# DATABASE_URL: "{{ database_url }}"
# CLOUDAMQP_URL: "{{ cloudamqp_url }}"
# CLOUDAMQP_APIKEY: "{{ cloudamqp_apikey }}"
CITY_COUNCIL_WEBSERVICE: "https://www.transparencia.feiradesantana.ba.leg.br/"
CITY_COUNCIL_WEBSERVICE_ENDPOINT: "http://transparencia.feiradesantana.ba.leg.br/webservice"
DJANGO_ALLOWED_HOSTS: ".mq.dadosabertosdefeira.com.br"
DJANGO_CONFIGURATION: "Prod"
DJANGO_SETTINGS_MODULE: "web.settings"
DOKKU_APP_TYPE: "dockerfile"
DOKKU_PROXY_PORT: "80"
DOKKU_PROXY_PORT_MAP: "http:80:5000"
ENABLE_AUTOTHROTTLE_DEBUG: "true"
NEW_RELIC_LOG: "stdout"
SENTRY_ENVIRONMENT: "Prod"
SPIDERMON_SENTRY_ENVIRONMENT_TYPE: "Prod"
TIKA_CLIENT_ONLY: "1"


# NEWRELIC INFRA
nrinfragent_integrations:
Expand Down
99 changes: 74 additions & 25 deletions group_vars/production/vault.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,75 @@
$ANSIBLE_VAULT;1.1;AES256
38616637303431616132643036643338396165383462343363316662313039613039336630383166
3237613939636662663430613065396539313137626661340a356165306166643934643539636235
66656334336636363035656633633638636534393666393630323638653661623664386561643634
6332316134386133630a613966356562633238323034343333313266346133306239613266656631
66393538653363306331353966303265633864303732656130633662636538313733373636393533
61326666643333393166313864343233666565306566383132386564376263353732346661373939
66303731316561623463396665393563623164396432393964303038386366316435666234613334
36373165363839396637633535663237646138623833666337666633363364383834656362323437
37643633633466613939353930393935633535343835356136343730333330316232623965623134
35323863316263353065636466363966313731323364323534616334313036646132373438383034
39353664633139633666643736316333366639356462353239643030396365636530386436343739
34643835386131656638303733336336613835373238303132306237636538383132323563303230
61623165393438353032363330613336376164316565336333333439623462396663356261343664
62396163323834326630376137313263366363623562376135656639613939383835666661636130
30666662326662363739646366363931366261303834636664643465663834643561396237356663
39623836626563323763346430396664383366666235306232626437623762346336383833643538
31373163346136666332396465383565343931636565303231613966333335633033636536643439
30636266666363356165666665346162646364653462383932383231353935633538643265646562
31633365373264383938646362373966353864353562386434313263613562656565663139313235
63623662363035353062653861393361613630666464623364386161303231393261343163313863
33656361626337333733343239343338306563663435613863316338653030623635613766656262
38386532666639356136306332393830346534653630666639376133626632656139393938653835
66383966356139303462346665626539383638613234336634613766656330343231303736656361
30343632333231646366316230323231643739663830306662393134366534393533396330313661
3731
61323331303034353666643834653531356138623335383933313866613235376133303530356563
3636363666643764303639646464626435343131626134660a653830303464623936646532663036
37323639613134333665353962643135376662623864393965323039303965326463646537353761
6165373833336537620a396234373464666139383765346132383438613435373538653536616230
36613738643532393461356234333638636666613532656232393762326132336439346632633638
65346235373038356466393234343131626231333537383661386662653133343439396534333761
65663133303061623533613231383933653737373765666166616437633163393539623864333463
65303136346135666164323163633538396536343637386639303739653665363836636533643535
37363564626562616264346533386531663336613332333330326165613930343934376239313638
34393135336439613465386366363635323662616662346361333737356166653961626666663835
33343832653465383437663762326163303766323439613430323365393337346430663833313937
64353736626339663137393031376462623938353730313130626433313837633432663562373163
37666135333832376335613236626238633731303937333462313262306465646132346139633465
30613031626334316139333730623161383934613265316331663935303063383436313535636565
32353230326433613063643634613761396564386165313938303430303934343465363436343037
63386332336537633939393266346639353030376333383164643930396134373164636431393863
34373137623064363232366337323564643562386231373335383236333034633639303333363836
36386139616365653164303530626239643532383335646566626662343837333563653864626263
34316530373339616537313265376336356161656531383030646636373239353935323838306565
33376162333064366631613965356538326361393864663437366437356261376662643162316633
34653566643136643138386132336430623131303537323336636630356434376236343961323038
66383931306463393332646565383038393863666139303435623538383564396239303830643433
65396161626565646266343239646663353963393435313562376432366665353635623766343336
36613261313631616433353865626630623461393233343361333039666231383231613832386534
32336163333665343665643365386333633739313633643333313663373961616532613765636562
38303363623232356262316665613764646662383235373937626235663438313133373832336337
62343337653766356266616236313434396137373265643039663662666135366335373730663162
66333931613035636363643261393432393061336534343035616230343937343563376462316438
31333934636364376631663234356535643339653738633335643264356433383238396134353664
38323565316239366662323133303832356664653262623533616233306335663731303464333432
38346165623036613231343837653361306532306438323138316431663839623065316536326531
34376262663031633563396337373030326233623761303038613439333530636232396262336462
63373265323338643865336566353061643434626138663361356563306632343362373839653561
61373732626235356631666130373537656462663534643937366331356462633736303230346162
38376338373966306263643266393261643530376231643734366333363363633866383730346334
63393238653039663063643665383166643438643736373661343332356233346636366563333730
34383438636336393163323338303462336665326161323664313630326561333830646530643938
37653764363265323038633538613561626365663661316266306266353932383531626665383364
34613166333831336161386565626431663165613361376434643764626639313831353637323338
38333962646434303936343237633162663863316332623236386132646634396630613064336238
36333762363331626664663632353963386132633636363437383239616436386633376432383535
61353464376336336237363064666533363061303236616264326461636364323462633933643935
38613232373234313138323031366235663331333066396332643330663038656338336436303061
34613238303130353436313739306134643032326336363664323962343066356134373730656535
65656138383730666332666635623231653334346636383139633234383636346334623636373038
35323765323539323762633339353739353732643766613036353565656437643739326664333930
65643030633135333332326135613631333464643264396663303930343431353238393832396661
33663236353334376366666235373633623066303263653761333330663764643664383736373039
33626533643937336430633436656333636237313631326230383362363037643036396565646137
37643731623766303631306364643331393735643065313164616639343837633366613163653637
36323537303237343536663864616362363837353961336231313334343964613563366261653664
30663231346261366632653933663537663230366665623865393239653132643266663934613736
61363361343136313439336261613838356563656231633265373134653839353033353631306632
36313261656461356562393737303266633639386639666566633230633639653731373632613733
30383738353262656664343430323031316339626434656237336165396666633034326237353735
32326665353831623164656238363436343265653234633034343132633362326530313236633934
30366337396239393931326236656463323961623430383034653362343366646631383365326233
64366232613633363731373336326537373934323662373665623537343233666631656533346437
39386537613334346638356132303664663339303431646665373634376462303738396634633665
39643261313932383436333835356531393736323139666166373039643935663135363763653239
39363535386466643930643630316665366361313566333461303431656361333038656534326331
31306238363538663161393463333638343030353866623431633935616565376432623566626461
61336135316538316430653232366437353233303765613732343861353638663938353739346464
64323234316435333133376462396364666438346133356137633765313330643765383038616139
36366636633533656438613936613132363863313330323565393766316239333832633631333638
61386336663436303262383666366434343638333438396431356232383031323336356435306164
31613333313034356661316138386662383237636432353463666162666436316138306130333762
66336562316366393739666130306436663634656537323237333566373134373165653436666433
39353533653439363263303432393930333566376636316664653731393163626539626639633033
62363534333835383062653330376633326661363033346263353232346639313665386136346539
61366336653934363865613365383161616137333739373032666233383365656233383361333939
62343538363866633236316633376635396235306361343034646433333034663439636130633862
63623636393437323163393730363763323135666637373965346563326439626631613263633031
3063303837613565373961353531376463366365343061633330
24 changes: 11 additions & 13 deletions playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,16 @@
dokku_config:
app: "{{ app }}"
config:
DOKKU_LETSENCRYPT_EMAIL: "{{ dokku_letsencrypt_email }}"
PORT: "{{ port }}"
# DATABASE_URL: "{{ database_url }}"
# CLOUDAMQP_URL: "{{ cloudamqp_url }}"
# CLOUDAMQP_APIKEY: "{{ cloudamqp_apikey }}"
CITY_COUNCIL_WEBSERVICE: "{{ city_council_webservice }}"
DJANGO_ALLOWED_HOSTS: "{{ django_allowed_hosts }}"
DJANGO_CONFIGURATION: "{{ django_configuration }}"
DJANGO_SECRET_KEY: "{{ django_secret_key }}"
DJANGO_SETTINGS_MODULE: "{{ django_settings_module }}"
ENABLE_AUTOTHROTTLE_DEBUG: "{{ enable_autothrottle_debug }}"
NEW_RELIC_LOG: "{{ new_relic_log }}"
"{{ apps_config }}"
when: apps_config is defined
#ignore_errors: yes
- name: environment configuration vault
dokku_config:
app: "{{ app }}"
config:
"{{ apps_config_vault }}"
when: apps_config_vault is defined
#ignore_errors: yes
- name: Add dokku_service network to mariaquiteria
command: "dokku network:set {{ app }} attach-post-create dokku_services"
args:
Expand All @@ -48,4 +46,4 @@
name: "Crawl diario"
minute: "0"
hour: "6"
job: "dokku run dadosabertosdefeira.com.br python manage.py crawl"
job: "dokku run {{ app }} python manage.py crawl"

0 comments on commit 8e9816c

Please sign in to comment.