Skip to content

Add ansible code for update kernel - #5

Merged
pegahnikbakht merged 18 commits into
mainfrom
RD-1552
Oct 13, 2026
Merged

pegahnikbakht merged 18 commits into
mainfrom
RD-1552

Conversation

@pegahnikbakht

Copy link
Copy Markdown
Contributor

latest kernel tested on azure and gcp and aws
specific kernel only tested on azure for now

@antoniacobaeus antoniacobaeus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Comment thread ansible/README.md Outdated

| Variable | Default | Description |
|---|---|---|
| `kernel_update_enabled` | | Set to `true` to run the kernel update. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this variable needed? What happens if it is omitted or false?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this.

Comment thread ansible/README.md
-e kernel_version=5.14.21-150500.55.65.1
```

## Finding available kernel versions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this!

Comment thread modules/aws/servers.tf
provisioner "remote-exec" {
inline = [
"cloud-init status --wait",
"if command -v cloud-init >/dev/null 2>&1; then cloud-init status --wait; fi",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread modules/aws/servers.tf
}
}

resource "null_resource" "attestation" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I keep this one for now.

@pegahnikbakht
pegahnikbakht merged commit 4a7b93c into main Oct 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants