terraform-provider-docker icon indicating copy to clipboard operation
terraform-provider-docker copied to clipboard

plan forces replacement every time on "command"

Open pva2007 opened this issue 2 years ago • 0 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and docker Provider) Version

Terraform v1.5.2 on darwin_amd64

  • provider registry.terraform.io/cloudflare/cloudflare v3.35.0
  • provider registry.terraform.io/hashicorp/random v3.4.3
  • provider registry.terraform.io/hashicorp/template v2.2.0
  • provider registry.terraform.io/hashicorp/vault v3.17.0
  • provider registry.terraform.io/kreuzwerker/docker v3.0.2

Affected Resource(s)

  • docker_container

Terraform Configuration Files

module "ocis" {
  source = "git::https://[email protected]/pva2007/tf-module-docker-resource.git?ref=v1.0.7"

  # required variables
  container_domainname         = var.docker_domainname
  disable_container_domainname = true
  container_hostname           = var.ocis_hostname
  container_name               = var.ocis_hostname
  prefix                       = basename(path.cwd)
  postfix                      = ""
  image_keep                   = true
  image_name                   = "owncloud/ocis:latest"
  networks                     = ["webgateway"]
  env = {
    "TZ"                                    = var.docker_timezone,
    "OCIS_URL"                              = "https://${var.ocis_hostname}.${var.docker_domainname}",
    "OCIS_LOG_LEVEL"                        = "info",
    "OCIS_LOG_COLOR"                        = true,
    "OCIS_LOG_PRETTY"                       = true,
    "PROXY_TLS"                             = false,
    "OCIS_INSECURE"                         = false,
    "PROXY_HTTP_ADDR"                       = "0.0.0.0:9200",
    "PROXY_ENABLE_BASIC_AUTH"               = false,
    "OCIS_DOMAIN"                           = "${var.ocis_hostname}.${var.docker_domainname}",
    "DEMO_USERS"                            = false,
    "OCIS_OIDC_ISSUER"                      = "${var.authentik_host}/application/o/owncloud-is/",
    "OCIS_EXCLUDE_RUN_SERVICES"             = "idp",
    "WEB_OIDC_CLIENT_ID"                    = "xxxx",
    "PROXY_OIDC_REWRITE_WELLKNOWN"          = true,
    "PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD" = "none",
    "PROXY_AUTOPROVISION_ACCOUNTS"          = true,
    #"PROXY_ROLE_ASSIGNMENT_DRIVER"          = "oidc",
    "STORAGE_USERS_DRIVER"          = "s3ng",
    "STORAGE_SYSTEM_DRIVER"         = "ocis",
    "STORAGE_USERS_S3NG_ENDPOINT"   = "https://s3.xxx.de",
    "STORAGE_USERS_S3NG_REGION"     = "www-xxx",
    "STORAGE_USERS_S3NG_ACCESS_KEY" = "xxxx",
    "STORAGE_USERS_S3NG_SECRET_KEY" = "xxx",
    "STORAGE_USERS_S3NG_BUCKET"     = "xxx.ocis"
  }

  ports = var.ocis_ports

  upload = {
    "ocis_yaml" = {
      file       = "/etc/ocis/ocis.yaml"
      content    = data.template_file.ocis_yaml.rendered
      executable = false
    }
  }

  host_volumes = {
    "data" = {
      container_path = "/var/lib/ocis"
      host_path      = "/mnt/vol-shared/${var.docker_domainname}/${var.ocis_hostname}/data"
      read_only      = false
    }
  }

  # traefik
  traefik_enable              = true
  traefik_acme_live_cert      = true
  traefik_certresolver        = "letsEncrypt"
  traefik_container_port      = var.ocis_containerport
  traefik_entrypoint          = "websecure"
  traefik_protocol            = "http"
  traefik_use_authentik_proxy = false
  traefik_host_rule_addons    = ""
}

Debug Output

https://gist.github.com/pva2007/fe802f0ae1066a8ad36c41f6050989ab

Panic Output

Expected Behaviour

No replacement as no chnages has been made, and command has not changed at all. OCIS is here my example as working latest on it.

Actual Behaviour

by every run terraform plan a force replacement will be trigered for section "command"

Steps to Reproduce

  1. terraform apply

Important Factoids

connection is done via ssh to remove host where docker is running. Statefile is on MinIO S3 Bucket.

References

  • #0000

pva2007 avatar Jul 05 '23 15:07 pva2007