Skip to content

Commit

Permalink
Merge pull request #659 from OpenImaging/update-cloudamqp-credentials
Browse files Browse the repository at this point in the history
Update cloudamqp credentials
  • Loading branch information
zachmullen authored Dec 14, 2023
2 parents b8ad2f4 + 13dc4d7 commit 1ce60d1
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 29 deletions.
25 changes: 25 additions & 0 deletions ansible/update_creds.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import os
import subprocess
import sys

APP = os.environ.get('APP', 'miqa-demo')

for env_var, var_name in [('CLOUDAMQP_URL', 'cloudamqp_url'), ('DATABASE_URL', 'database_url')]:
result = subprocess.run(
['heroku', 'run', '-a', APP, 'echo', f'${env_var}'],
capture_output=True
)
plaintext = result.stdout.decode().strip()
print(f'{env_var}={plaintext}')

subprocess.run(
[
'ansible-vault', 'encrypt_string',
'--vault-password-file=vault-password',
plaintext,
'--name',
var_name,
],
stdout=sys.stdout,
stderr=sys.stderr,
)
52 changes: 23 additions & 29 deletions ansible/vaultvars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,33 @@ aws_secret_access_key: !vault |
6364313165613331620a653030653734383937633330356466383736666665353337386537333966
37326166623764636133633234653564386565386666343230646464623533383333393734636664
3031643030303730393635336233626661653561633562393066
cloudamqp_api_key: !vault |
$ANSIBLE_VAULT;1.1;AES256
36303230303132396333313833306230303135323563613164623437306330326239313066646134
6566363833636361663130613262626139623361333961330a316165386435336534643936613034
35326266383838346432633136393363383965626436353537313437363234316362343234646634
6133366339616231630a623333643935393130303866376161663861636637303938656636356339
32326161376664386534626537383430363535383735623536633532356636333962616364343064
3832383539383435666639633365613133353530316265336638
cloudamqp_url: !vault |
$ANSIBLE_VAULT;1.1;AES256
37393139346635666132616165643238343239653438636332636338366461316537313961663865
3566323837373739656663336138373963613262616432660a653963663236393738633261386536
61353935393630376466373130313035393936656661386238323631646362353561383633303632
6235623132386537330a336533646135643461343265623161663730643464666137616439663961
63643333656434613734616135366634613634376339336536363838343235323739653762633435
61323436616533383539316637663439616439313539623734643133373933343766656430653039
39336466396164333435613965396434666461643031366362326534383339323730636235363435
36306461326533646663633564386362613538326532313934313062643830623166336338633565
3362
38386437373731646630623330646566356139663839356661383438333636623035306331623839
6232646166343139313961636230306166373863653561660a343862343730663533373835356232
63653234663738613562643863643835373739346530363338346663663739386139363466313934
6662373961363338610a633535653062616336323836333062336437646461323366346432316130
61623663383436313836393834326234333562323238363766363465393466313530343235303237
61636537333731306265613666383664376566396565356138386631323536313363343134313537
32653736653866313962663031396333343064623736396130313736643961613764363939653138
65393231326664643338663039346161303935656232363861396339373762386331666133643935
6136
database_url: !vault |
$ANSIBLE_VAULT;1.1;AES256
37393039633939323234363134323435356531376537313635666236663934626530336634633634
3163363933326164386537633238623661663337373962630a363830356337386137336232613836
62663264393534336231393166613336363461316163646137336265306165313138383762663966
6536306366303466300a663637363034643461313433323636383934363434346561343037386337
63353234356430313731653237343034623363653433343736396130623766643737363666643330
63643739396233613431363662643530653536643363373735333134353830353036326135666535
65656331633730346564383938363839663562623931303464373166376437383831386130343636
36646137633863336335666338373462626234643931376636616139333535656332326266333765
33643036333538633566346231336234666230343161396562353134393033646636393637336633
34356365393662363765323161336331653462396136383836313262623466386337633336363335
62663639656566376334373438363130353534626138396661626234333037333139663966373133
39386436366130663838
64326639313966393061373466643432613864353534333764363335323338653433303230303735
3533626462653664323033343536343632636535333230650a383361376133326233643237386334
33336263373034323562666634383232383339333662613865633739313932373762343665613363
3561613039656265390a343238643035373932323066323836326263356262653537393161353131
64613336633866633362333963663666663864336564303064366266373933616532633032343663
62653435383333343338383661626332306635343532623063303235376133666132303931376134
37396264666238656637363334363431323665393033336366373235623161653263386163643630
35663139306365393239353439373235346331626166623933666264663763633630643163333130
37383662303063656333646531363861623238633866373234646665393162623461313830336432
64373934396566383731356237306536616666373362626139616563363663383930323432663336
34633464333733323939373564613331643464663339646433343332643633393263396533383861
64643264616663333765636130396432333833656236653363336330343139303261393732323665
61646139306139303430393466643437356366303461373832383662306230386366636361313664
3939306364393666336132356466646136336139653965396361
email_url: !vault |
$ANSIBLE_VAULT;1.1;AES256
30656231306137343266323937346264353134316338386362643264343336643236636161623830
Expand Down

0 comments on commit 1ce60d1

Please sign in to comment.