Repository navigation
Add ansible code for update kernel - #5
Conversation
antoniacobaeus
left a comment
There was a problem hiding this comment.
I approve the approach to use Ansible. I haven't really reviewed the Ansible script in detail, but if it works I would say it is good enough.
I am a bit hesitant on the changes to the Terraform code, maybe we can skip it for now, but I'll leave that to you!
|
|
||
| | Variable | Default | Description | | ||
| |---|---|---| | ||
| | `kernel_update_enabled` | | Set to `true` to run the kernel update. | |
There was a problem hiding this comment.
Is this variable needed? What happens if it is omitted or false?
There was a problem hiding this comment.
Removed this.
| -e kernel_version=5.14.21-150500.55.65.1 | ||
| ``` | ||
|
|
||
| ## Finding available kernel versions |
| provisioner "remote-exec" { | ||
| inline = [ | ||
| "cloud-init status --wait", | ||
| "if command -v cloud-init >/dev/null 2>&1; then cloud-init status --wait; fi", |
There was a problem hiding this comment.
Was this added to prevent it from crashing when cloud-init is missing, like in the GCP + RHEL case?
If so we might not need it for the rest (AWS and Azure), but it probably doesn't hurt.
Furthermore, I am not sure if it is the best solution as the attestation will fail nonetheless. Does this stop the process before the client gets called (next line)?
There was a problem hiding this comment.
In RD-1598 this is kind of fixed.
GCP is different from others and Azure and AWS are changes also so that the terraform does not wait for cloud-init forever.
| } | ||
| } | ||
|
|
||
| resource "null_resource" "attestation" { |
There was a problem hiding this comment.
Does this need to be a separate null_resource? It feels a bit clunky, but if the provisioner in of itself cannot be disabled then it seems like the only way.
I am also wondering if this kind of mechanism is still needed, now that the kernel update is outside of Terraform.
There was a problem hiding this comment.
I keep this one for now.
latest kernel tested on azure and gcp and aws
specific kernel only tested on azure for now