diff options
author | Christopher Baines <mail@cbaines.net> | 2018-06-21 23:11:11 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2018-06-21 23:11:11 +0100 |
commit | 8e19306b741e54b08ea97c8e6d94458b832ddd63 (patch) | |
tree | 7b079bc26d1da64377535f599b3f429053b167a5 /app/models | |
parent | 4c6b3b725275eaa8a87c22c56e0086722e7a7748 (diff) | |
download | govuk-mini-environment-admin-8e19306b741e54b08ea97c8e6d94458b832ddd63.tar govuk-mini-environment-admin-8e19306b741e54b08ea97c8e6d94458b832ddd63.tar.gz |
Add a refresh action to the MiniEnvironment class
This can then be used to update the Terraform state for the Mini
Environment.
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/backends/terraform_libvirt/mini_environment_methods.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/backends/terraform_libvirt/mini_environment_methods.rb b/app/models/backends/terraform_libvirt/mini_environment_methods.rb index b89a07f..c931a5d 100644 --- a/app/models/backends/terraform_libvirt/mini_environment_methods.rb +++ b/app/models/backends/terraform_libvirt/mini_environment_methods.rb @@ -63,6 +63,14 @@ module Backends::TerraformLibvirt::MiniEnvironmentMethods end end + def refresh(mini_environment) + within_terraform_working_directory(mini_environment) do + RubyTerraform.refresh( + vars: terraform_variables(mini_environment) + ) + end + end + def terraform_states(mini_environment) TerraformState.where( state_id: mini_environment_state_id(mini_environment) |