inventory: Apply updated terraform script
Update terraform script and apply it to get updated version of ansible inventory file. Referenced issue: https://github.com/status-im/infra-template/issues/10 Signed-off-by: markoburcul <marko@status.im>
This commit is contained in:
parent
f8c8dac98d
commit
3fdecedd83
|
@ -1,18 +1,18 @@
|
|||
# NOTE: This file is generated by terraform.py
|
||||
# For emergency use when Consul fails
|
||||
[all]
|
||||
boot-01.ac-cn-hongkong-c.status.prod hostname=boot-01.ac-cn-hongkong-c.status.prod ansible_host=8.218.23.76 env=status stage=prod data_center=ac-cn-hongkong-c region=cn-hongkong-c dns_entry=boot-01.ac-cn-hongkong-c.status.prod.status.im
|
||||
boot-01.do-ams3.status.prod hostname=boot-01.do-ams3.status.prod ansible_host=167.99.19.47 env=status stage=prod data_center=do-ams3 region=ams3 dns_entry=boot-01.do-ams3.status.prod.status.im
|
||||
boot-01.gc-us-central1-a.status.prod hostname=boot-01.gc-us-central1-a.status.prod ansible_host=34.135.13.87 env=status stage=prod data_center=gc-us-central1-a region=us-central1-a dns_entry=boot-01.gc-us-central1-a.status.prod.status.im
|
||||
store-01.ac-cn-hongkong-c.status.prod hostname=store-01.ac-cn-hongkong-c.status.prod ansible_host=8.218.74.73 env=status stage=prod data_center=ac-cn-hongkong-c region=cn-hongkong-c dns_entry=store-01.ac-cn-hongkong-c.status.prod.status.im
|
||||
store-01.do-ams3.status.prod hostname=store-01.do-ams3.status.prod ansible_host=159.223.242.94 env=status stage=prod data_center=do-ams3 region=ams3 dns_entry=store-01.do-ams3.status.prod.status.im
|
||||
store-01.gc-us-central1-a.status.prod hostname=store-01.gc-us-central1-a.status.prod ansible_host=34.170.192.39 env=status stage=prod data_center=gc-us-central1-a region=us-central1-a dns_entry=store-01.gc-us-central1-a.status.prod.status.im
|
||||
store-02.ac-cn-hongkong-c.status.prod hostname=store-02.ac-cn-hongkong-c.status.prod ansible_host=8.218.121.232 env=status stage=prod data_center=ac-cn-hongkong-c region=cn-hongkong-c dns_entry=store-02.ac-cn-hongkong-c.status.prod.status.im
|
||||
store-02.do-ams3.status.prod hostname=store-02.do-ams3.status.prod ansible_host=159.223.242.154 env=status stage=prod data_center=do-ams3 region=ams3 dns_entry=store-02.do-ams3.status.prod.status.im
|
||||
store-02.gc-us-central1-a.status.prod hostname=store-02.gc-us-central1-a.status.prod ansible_host=34.170.154.2 env=status stage=prod data_center=gc-us-central1-a region=us-central1-a dns_entry=store-02.gc-us-central1-a.status.prod.status.im
|
||||
store-db-01.ac-cn-hongkong-c.status.prod hostname=store-db-01.ac-cn-hongkong-c.status.prod ansible_host=47.243.139.240 env=status stage=prod data_center=ac-cn-hongkong-c region=cn-hongkong-c dns_entry=store-db-01.ac-cn-hongkong-c.status.prod.status.im
|
||||
store-db-01.do-ams3.status.prod hostname=store-db-01.do-ams3.status.prod ansible_host=161.35.247.243 env=status stage=prod data_center=do-ams3 region=ams3 dns_entry=store-db-01.do-ams3.status.prod.status.im
|
||||
store-db-01.gc-us-central1-a.status.prod hostname=store-db-01.gc-us-central1-a.status.prod ansible_host=34.71.57.210 env=status stage=prod data_center=gc-us-central1-a region=us-central1-a dns_entry=store-db-01.gc-us-central1-a.status.prod.status.im
|
||||
boot-01.ac-cn-hongkong-c.status.prod ansible_host=8.218.23.76 data_center=ac-cn-hongkong-c dns_domain=status.im dns_entry=boot-01.ac-cn-hongkong-c.status.prod.status.im env=status region=cn-hongkong-c stage=prod
|
||||
boot-01.do-ams3.status.prod ansible_host=167.99.19.47 data_center=do-ams3 dns_domain=status.im dns_entry=boot-01.do-ams3.status.prod.status.im env=status region=ams3 stage=prod
|
||||
boot-01.gc-us-central1-a.status.prod ansible_host=34.135.13.87 data_center=gc-us-central1-a dns_entry=boot-01.gc-us-central1-a.status.prod.status.im env=status region=us-central1-a stage=prod
|
||||
store-01.ac-cn-hongkong-c.status.prod ansible_host=8.218.74.73 data_center=ac-cn-hongkong-c dns_domain=status.im dns_entry=store-01.ac-cn-hongkong-c.status.prod.status.im env=status region=cn-hongkong-c stage=prod
|
||||
store-01.do-ams3.status.prod ansible_host=159.223.242.94 data_center=do-ams3 dns_domain=status.im dns_entry=store-01.do-ams3.status.prod.status.im env=status region=ams3 stage=prod
|
||||
store-01.gc-us-central1-a.status.prod ansible_host=34.170.192.39 data_center=gc-us-central1-a dns_entry=store-01.gc-us-central1-a.status.prod.status.im env=status region=us-central1-a stage=prod
|
||||
store-02.ac-cn-hongkong-c.status.prod ansible_host=8.218.121.232 data_center=ac-cn-hongkong-c dns_domain=status.im dns_entry=store-02.ac-cn-hongkong-c.status.prod.status.im env=status region=cn-hongkong-c stage=prod
|
||||
store-02.do-ams3.status.prod ansible_host=159.223.242.154 data_center=do-ams3 dns_domain=status.im dns_entry=store-02.do-ams3.status.prod.status.im env=status region=ams3 stage=prod
|
||||
store-02.gc-us-central1-a.status.prod ansible_host=34.170.154.2 data_center=gc-us-central1-a dns_entry=store-02.gc-us-central1-a.status.prod.status.im env=status region=us-central1-a stage=prod
|
||||
store-db-01.ac-cn-hongkong-c.status.prod ansible_host=47.243.139.240 data_center=ac-cn-hongkong-c dns_domain=status.im dns_entry=store-db-01.ac-cn-hongkong-c.status.prod.status.im env=status region=cn-hongkong-c stage=prod
|
||||
store-db-01.do-ams3.status.prod ansible_host=161.35.247.243 data_center=do-ams3 dns_domain=status.im dns_entry=store-db-01.do-ams3.status.prod.status.im env=status region=ams3 stage=prod
|
||||
store-db-01.gc-us-central1-a.status.prod ansible_host=34.71.57.210 data_center=gc-us-central1-a dns_entry=store-db-01.gc-us-central1-a.status.prod.status.im env=status region=us-central1-a stage=prod
|
||||
|
||||
[ac-cn-hongkong-c]
|
||||
boot-01.ac-cn-hongkong-c.status.prod
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
# NOTE: This file is generated by terraform.py
|
||||
# For emergency use when Consul fails
|
||||
[all]
|
||||
boot-01.ac-cn-hongkong-c.status.staging hostname=boot-01.ac-cn-hongkong-c.status.staging ansible_host=47.76.168.186 env=status stage=staging data_center=ac-cn-hongkong-c region=cn-hongkong-c dns_entry=boot-01.ac-cn-hongkong-c.status.staging.status.im
|
||||
boot-01.do-ams3.status.staging hostname=boot-01.do-ams3.status.staging ansible_host=143.198.250.233 env=status stage=staging data_center=do-ams3 region=ams3 dns_entry=boot-01.do-ams3.status.staging.status.im
|
||||
boot-01.gc-us-central1-a.status.staging hostname=boot-01.gc-us-central1-a.status.staging ansible_host=104.197.5.96 env=status stage=staging data_center=gc-us-central1-a region=us-central1-a dns_entry=boot-01.gc-us-central1-a.status.staging.status.im
|
||||
store-01.ac-cn-hongkong-c.status.staging hostname=store-01.ac-cn-hongkong-c.status.staging ansible_host=8.218.206.134 env=status stage=staging data_center=ac-cn-hongkong-c region=cn-hongkong-c dns_entry=store-01.ac-cn-hongkong-c.status.staging.status.im
|
||||
store-01.do-ams3.status.staging hostname=store-01.do-ams3.status.staging ansible_host=24.144.78.119 env=status stage=staging data_center=do-ams3 region=ams3 dns_entry=store-01.do-ams3.status.staging.status.im
|
||||
store-01.gc-us-central1-a.status.staging hostname=store-01.gc-us-central1-a.status.staging ansible_host=35.224.231.209 env=status stage=staging data_center=gc-us-central1-a region=us-central1-a dns_entry=store-01.gc-us-central1-a.status.staging.status.im
|
||||
store-02.ac-cn-hongkong-c.status.staging hostname=store-02.ac-cn-hongkong-c.status.staging ansible_host=47.76.178.164 env=status stage=staging data_center=ac-cn-hongkong-c region=cn-hongkong-c dns_entry=store-02.ac-cn-hongkong-c.status.staging.status.im
|
||||
store-02.do-ams3.status.staging hostname=store-02.do-ams3.status.staging ansible_host=24.144.78.120 env=status stage=staging data_center=do-ams3 region=ams3 dns_entry=store-02.do-ams3.status.staging.status.im
|
||||
store-02.gc-us-central1-a.status.staging hostname=store-02.gc-us-central1-a.status.staging ansible_host=34.72.140.183 env=status stage=staging data_center=gc-us-central1-a region=us-central1-a dns_entry=store-02.gc-us-central1-a.status.staging.status.im
|
||||
store-db-01.ac-cn-hongkong-c.status.staging hostname=store-db-01.ac-cn-hongkong-c.status.staging ansible_host=47.76.183.131 env=status stage=staging data_center=ac-cn-hongkong-c region=cn-hongkong-c dns_entry=store-db-01.ac-cn-hongkong-c.status.staging.status.im
|
||||
store-db-01.do-ams3.status.staging hostname=store-db-01.do-ams3.status.staging ansible_host=24.144.78.121 env=status stage=staging data_center=do-ams3 region=ams3 dns_entry=store-db-01.do-ams3.status.staging.status.im
|
||||
store-db-01.gc-us-central1-a.status.staging hostname=store-db-01.gc-us-central1-a.status.staging ansible_host=34.173.29.3 env=status stage=staging data_center=gc-us-central1-a region=us-central1-a dns_entry=store-db-01.gc-us-central1-a.status.staging.status.im
|
||||
boot-01.ac-cn-hongkong-c.status.staging ansible_host=47.76.168.186 data_center=ac-cn-hongkong-c dns_domain=status.im dns_entry=boot-01.ac-cn-hongkong-c.status.staging.status.im env=status region=cn-hongkong-c stage=staging
|
||||
boot-01.do-ams3.status.staging ansible_host=143.198.250.233 data_center=do-ams3 dns_domain=status.im dns_entry=boot-01.do-ams3.status.staging.status.im env=status region=ams3 stage=staging
|
||||
boot-01.gc-us-central1-a.status.staging ansible_host=104.197.5.96 data_center=gc-us-central1-a dns_entry=boot-01.gc-us-central1-a.status.staging.status.im env=status region=us-central1-a stage=staging
|
||||
store-01.ac-cn-hongkong-c.status.staging ansible_host=8.218.206.134 data_center=ac-cn-hongkong-c dns_domain=status.im dns_entry=store-01.ac-cn-hongkong-c.status.staging.status.im env=status region=cn-hongkong-c stage=staging
|
||||
store-01.do-ams3.status.staging ansible_host=24.144.78.119 data_center=do-ams3 dns_domain=status.im dns_entry=store-01.do-ams3.status.staging.status.im env=status region=ams3 stage=staging
|
||||
store-01.gc-us-central1-a.status.staging ansible_host=35.224.231.209 data_center=gc-us-central1-a dns_entry=store-01.gc-us-central1-a.status.staging.status.im env=status region=us-central1-a stage=staging
|
||||
store-02.ac-cn-hongkong-c.status.staging ansible_host=47.76.178.164 data_center=ac-cn-hongkong-c dns_domain=status.im dns_entry=store-02.ac-cn-hongkong-c.status.staging.status.im env=status region=cn-hongkong-c stage=staging
|
||||
store-02.do-ams3.status.staging ansible_host=24.144.78.120 data_center=do-ams3 dns_domain=status.im dns_entry=store-02.do-ams3.status.staging.status.im env=status region=ams3 stage=staging
|
||||
store-02.gc-us-central1-a.status.staging ansible_host=34.72.140.183 data_center=gc-us-central1-a dns_entry=store-02.gc-us-central1-a.status.staging.status.im env=status region=us-central1-a stage=staging
|
||||
store-db-01.ac-cn-hongkong-c.status.staging ansible_host=47.76.183.131 data_center=ac-cn-hongkong-c dns_domain=status.im dns_entry=store-db-01.ac-cn-hongkong-c.status.staging.status.im env=status region=cn-hongkong-c stage=staging
|
||||
store-db-01.do-ams3.status.staging ansible_host=24.144.78.121 data_center=do-ams3 dns_domain=status.im dns_entry=store-db-01.do-ams3.status.staging.status.im env=status region=ams3 stage=staging
|
||||
store-db-01.gc-us-central1-a.status.staging ansible_host=34.173.29.3 data_center=gc-us-central1-a dns_entry=store-db-01.gc-us-central1-a.status.staging.status.im env=status region=us-central1-a stage=staging
|
||||
|
||||
[ac-cn-hongkong-c]
|
||||
boot-01.ac-cn-hongkong-c.status.staging
|
||||
|
|
|
@ -413,12 +413,9 @@ def _backup_ansible(inventory):
|
|||
text += '# For emergency use when Consul fails\n'
|
||||
text += '[all]\n'
|
||||
for hostname, host in sorted(inventory.hosts.items()):
|
||||
text += (
|
||||
'{0} hostname={0} ansible_host={1} '
|
||||
).format(hostname, host.host_vars['ansible_host']) + (
|
||||
'env={env} stage={stage} data_center={data_center} '+
|
||||
'region={region} dns_entry={dns_entry}\n'
|
||||
).format(**host.host_vars)
|
||||
host_vars = {k: v for k, v in host.host_vars.items() if k != 'hostname'}
|
||||
vars_text = " ".join(f"{k}={v}" for k,v in host_vars.items())
|
||||
text += f"{hostname} {vars_text}\n"
|
||||
text += '\n'
|
||||
for name, hosts in sorted(inventory.groups.items()):
|
||||
if name in ['_meta', 'all']:
|
||||
|
|
Loading…
Reference in New Issue