-
Notifications
You must be signed in to change notification settings - Fork 43
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
application placement to any machine/container/kvm doesn't work if machine is not started #506
Comments
after doing some other work, this is not just an LXD issue, but any machine. My simple plan below had to be run in 2 stages resource "juju_model" "microk8s" {
name = var.mk8s-model-name
cloud {
name = var.cloud
}
config = {
apt-mirror = "http://${var.apt_mirror}/archive.ubuntu.com/ubuntu"
lxd-snap-channel = var.lxd-snap-channel
container-image-metadata-url = "http://${var.apt_mirror}/lxd/"
container-image-stream = "released"
agent-metadata-url = "http://${var.apt_mirror}/juju/tools/"
agent-stream = "released"
}
}
resource "juju_machine" "mk8s" {
for_each = {
for index, machine in var.mk8s-machines:
machine.machine_id => machine
}
# model = var.mk8s-model-name
model = juju_model.microk8s.name
name = each.value.machine_id
constraints = each.value.constraints
#base = each.value.base
}
resource "juju_application" "microk8s" {
name = "microk8s"
#model = var.mk8s-model-name
model = juju_model.microk8s.name
charm {
name = "microk8s"
channel = "1.28/stable"
base = "[email protected]"
}
units = 4
placement = "${join(",", sort([
for res in juju_machine.mk8s :
res.machine_id
]))}"
config = {
}
} The error below
|
This is juju behavior and not specific to the terraform provider. To deploy an application juju must know the operating system to use. If an actual machine is used in deployment, the operating system of the machine must be known. It is used to deploy the application, or to validate against the operating system specified for the application. The fix is for the terraform provider to wait for the machine to finish provisioning before returning from creating the machine resource. Thus delaying the application deployment. |
See #116 for additional info |
Description
When you create tf plan with physical + lxd + application, then this will not apply in the first instance.
We now have to wait for the lxd to be active for the application to be added.
This was working with juju 2.9
Urgency
Annoying bug in our test suite
Terraform Juju Provider version
0.12.0
Terraform version
1.9.0
Juju version
3.4.3
Terraform Configuration(s)
Reproduce / Test
The text was updated successfully, but these errors were encountered: