alan-turing-institute / data-safe-haven

https://data-safe-haven.readthedocs.io
BSD 3-Clause "New" or "Revised" License
57 stars 15 forks source link

Cloud-init variables #2075

Closed jemrobinson closed 1 week ago

jemrobinson commented 1 month ago

:white_check_mark: Checklist

:strawberry: Suggested change

We currently expand our cloud-init file with a local of instance-specific variables. It would be better to pass these to Ansible for expansion in templates.

:steam_locomotive: How could this be done?

Not sure on the best way to pass variables to the Ansible playbook. @JimMadge might have thoughts.

JimMadge commented 1 month ago

Ansible docs on using variables.

The best option for us is probably to write the variables as YAML or JSON and upload that to the desired state blob as something like vars/pulumi_vars.yaml.

In the playbook we can then do

- hosts: all
  vars_files:
    - vars/pulumi_vars.yaml