Skip to content

Feature request: Provider resource to perform juju exec operations #944

Description

@vishvikkrishnan

Requirements

Wishlisting this feature request to have a standalone resource for juju exec operations.

It is handy to use juju exec to perform operations not (yet) readily exposed as charm actions. Currently, this requires using the local-exec provisioner.

Urgency

Casually wishlisting

Notes & References

resource "terraform_data" "prevent_upgrades" {
  depends_on = [terraform_data.juju_wait_for_end]
  provisioner "local-exec" {
    command = <<-EOT
      juju exec -m $MODEL --all -- sudo snap refresh --hold
      juju exec -m $MODEL --all -- sudo sed -i 's/APT::Periodic::Unattended-Upgrade "1";/APT::Periodic::Unattended-Upgrade "0";/' /etc/apt/apt.conf.d/*
    EOT
    environment = {
      MODEL = module.juju_model.model_name
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featuresuggests new feature or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions