Skip to content
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

Visions of an incus made out of tofu. 🤔 #1

Merged
merged 11 commits into from
Apr 5, 2024

Conversation

jarrodu
Copy link
Contributor

@jarrodu jarrodu commented Mar 10, 2024

I worked a bit with the Tofu and Ansible code in your project.

I got the Tofu to work on some of my hardware. I was also able to apply the Ansible code, but I got some errors near the end on the server nodes.

These commits are more a stream of consciousness, and are probably pretty opinionated. I thought I would share them with you so that you know that I am working on the project.

Feel free to do a code review. We could chat about some of the changes I made so far. I have more ideas, but they can wait till later.

Comment on lines 2 to 6
required_version = "1.6.2"
required_providers {
incus = {
source = "lxc/incus"
source = "lxc/incus"
version = "0.1.0"
Copy link
Member

Choose a reason for hiding this comment

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

Not sure about that since I'm deploying with a mix of Terraform and OpenTofu so the version requirement is going to become annoying.

Same thing on the Incus side. I think once we start needing a specific feature to have this work, we'll do a ">=" condition but until then, any version should work fine.

Comment on lines 2 to 8
required_version = "1.6.2"
required_providers {
incus = {
source = "lxc/incus"
version = "0.1.0"
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Same comment about version pinning.

Comment on lines +148 to +150
lifecycle {
ignore_changes = [ running ]
}
Copy link
Member

Choose a reason for hiding this comment

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

What does that do exactly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It prevents Tofu from turning on and off the instances when the state is controlled externally to Tofu.I prefer to do that with different tooling. In my case, I would use the Incus CLI.

The AWS, etc. providers offer the ability to control the on off state of instances, but it is opt in and discouraged.

Ideally the incus provider would work the same way. Then we would not need to disable it.

But what does it do exactly? It tells Tofu to ignore that part of the state file.

@jarrodu
Copy link
Contributor Author

jarrodu commented Mar 13, 2024

I will clean this up after the weekend. There are a few more commits I have been thinking about adding too.

I am away from my computers at the moment, though.

@jarrodu
Copy link
Contributor Author

jarrodu commented Mar 17, 2024

I pushed a few commits. I proposed new version strategy in 4e21e83. We can still leave them out if you want, but I always use them on my projects.

The other ideas I had can wait. I think I might have found a bug in the Incus provider.

@jarrodu
Copy link
Contributor Author

jarrodu commented Mar 23, 2024

It looks like the DCO is new. I got an email about it this morning. Do you still have interest in this PR? If so, I can find some time to add the DCO signatures.

@stgraber
Copy link
Member

Hey @jarrodu, I'm definitely still interested in those changes, just been swamped with the 0.7 and LTS release :)

Don't worry about the DCO stuff, once I finally get to spend some time incorporating those changes, I'll squash things into a few commits and add the Signed-off-by: Jarrod Urban <[email protected]> line in the commit message for you.

@stgraber
Copy link
Member

stgraber commented Apr 5, 2024

Did a big rebase and reorg of the changes now, still the exact same changes, just cleaned up in a bunch of separate commits with descriptions and correct sign-off.

@stgraber stgraber merged commit 9ada791 into lxc:main Apr 5, 2024
2 checks passed
@stgraber
Copy link
Member

stgraber commented Apr 5, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants