Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly handle workflows rollback and execution destroy #103

Open
rtortori opened this issue Jun 24, 2021 · 1 comment
Open

Properly handle workflows rollback and execution destroy #103

rtortori opened this issue Jun 24, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@rtortori
Copy link

Currently it seems if we terraform destroy an execution we remove it from the state file and clear it from the Requests in Intersight.

Ideally, in this specific context a Terraform destroy should:

  • Optionally avoid the deletion in Intersight (in case we want to keep the list of executions) if a specific parameter is set by the user in the resource
  • Automatically rollback the workflow if rollback_action = "Enabled" maybe by calling the code present in the intersight_workflow_rollback_workflow resource.

Sample TF Code

resource "intersight_workflow_workflow_info" "claimhttp" {
  name         = "claimhttp"
  action = "Start"
 
  input = {
    "name" = "httpbin"
    "endpoint" = "httpbin.org"
  }

  organization {
    object_type = "organization.Organization"
    moid        = var.organization
  }
  workflow_definition {
    object_type = "workflow.WorkflowDefinition"
    moid        = var.workflow_moid
  }
}
@code-lucidal58 code-lucidal58 self-assigned this Jul 16, 2021
@code-lucidal58 code-lucidal58 added the enhancement New feature or request label Jul 16, 2021
@code-lucidal58
Copy link
Contributor

@rtortori If a workflow triggering resource is destroyed, then the corresponding workflow is also deleted. It can be modified to just terminate the workflow if it is still running. Today, it is deleted as well. If I understand you correctly, I think this is the correct approach for "deleting" workflows, i.e. just terminate.

Regarding the rollback action, the creation of resources cannot be controlled through logic. Rather, you can create a dependency between workflowInfo and RollbackBackWorkflow resources. The RollbackBackWorkflow's action will depend on the value of one of the properties (rollback enable) of workflowInfo resource.

@code-lucidal58 code-lucidal58 changed the title [BUG] Properly handle workflows rollback and execution destroy Properly handle workflows rollback and execution destroy Jul 16, 2021
@code-lucidal58 code-lucidal58 removed their assignment Oct 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants