Mr_Neezer
Mr_Neezer
Explore posts from servers
CCoder.com
Created by Mr_Neezer on 10/7/2022 in #help
Prevent destroying and recreating home volume on workspace update
Nm, I don't. Things look like they're working as-expected now. Thanks @kyle !
72 replies
CCoder.com
Created by Mr_Neezer on 10/7/2022 in #help
Prevent destroying and recreating home volume on workspace update
Do I need to change the value in my snippet above, or is just adding the count property sufficient?
72 replies
CCoder.com
Created by Mr_Neezer on 10/7/2022 in #help
Prevent destroying and recreating home volume on workspace update
Thanks for the clarification, @kyle . I've a related question: I'm trying to configure a db firewall resource (https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/database_firewall) that uses the ID of the droplet created:
rule {
type = "droplet"
value = digitalocean_droplet.workspace[0].id
}
rule {
type = "droplet"
value = digitalocean_droplet.workspace[0].id
}
This consistently gives me this error on template push:
Error: Invalid index The given key does not identify an element in this collection value: the collection has no elements.
I've tried adding depends_on = [digitalocean_droplet.workspace] but that doesn't seem to make a difference. This feels related to the count logic from above... is it?
72 replies
CCoder.com
Created by Mr_Neezer on 10/7/2022 in #help
Prevent destroying and recreating home volume on workspace update
Ahh, ok. I had removed all the references to count... turns out those are needed, otherwise the droplet is still listed in the project resource list. Adding that back in and the droplet doesn't get re-created when stopping. Still not 💯 sure I understand what count is though; could you explain?
72 replies
CCoder.com
Created by Mr_Neezer on 10/14/2022 in #help
SSH Config for other apps?
11 replies
CCoder.com
Created by Mr_Neezer on 10/14/2022 in #help
SSH Config for other apps?
I don't think it delegates to the CLI, but I guess I can double-check with the publisher.
you could run a ssh server within the container and use coder port-forward
Hmm, seems like more work than I'd want right now. I'd really love to be able to re-use that wildcard domain... could I configure SSH as a "coder_app" and leverage the mechanics for the wildcard domain, maybe?
11 replies
CCoder.com
Created by Mr_Neezer on 10/14/2022 in #help
SSH Config for other apps?
The edits that coder config-ssh makes are still reliant on the coder CLI (see ProxyCommand), so I don't think they can be copy/pasted into another app like I'm trying to do here.
11 replies
CCoder.com
Created by Mr_Neezer on 10/14/2022 in #help
SSH Config for other apps?
Tangential question, can I configure DNS to resolve to my individual workspace? Kinda like how Coder uses the wildcard URL to host subapps, could that also be a target to enter in as an address for SSH config?
11 replies
CCoder.com
Created by Mr_Neezer on 10/7/2022 in #help
Prevent destroying and recreating home volume on workspace update
@kyle Weeeellll, may have spoken a bit too soon. The above does work as I described, but I'm noticing now that when I stop my workspace, my old droplet is destroyed (good) but a new droplet is created (wha??) From the very end of the logs for a "stop":
Apply complete! Resources: 4 added, 1 changed, 4 destroyed.
Looks like it basically just cycled the workspace instead of actually stopping it.
72 replies
CCoder.com
Created by Mr_Neezer on 10/7/2022 in #help
Prevent destroying and recreating home volume on workspace update
@kyle Performing the mount manually in runcmd worked:
runcmd:
- mount -o discard,defaults,noatime /dev/disk/by-id/scsi-0DO_Volume_${home_volume_name} /home/${username}
- echo '/dev/disk/by-id/scsi-0DO_Volume_${home_volume_name} /home/${username} ext4 defaults,uid=1000,gid=1000,nofail,discard 0 0' | tee -a /etc/fstab
runcmd:
- mount -o discard,defaults,noatime /dev/disk/by-id/scsi-0DO_Volume_${home_volume_name} /home/${username}
- echo '/dev/disk/by-id/scsi-0DO_Volume_${home_volume_name} /home/${username} ext4 defaults,uid=1000,gid=1000,nofail,discard 0 0' | tee -a /etc/fstab
Tested through a full stop/start cycle, and no errors in cloud-init log, I see the mount in mount output, and files I save to my home directory now persist. Not sure why the mounts module wasn't working as expected; this is the second cloud-init module that doesn't seem to work as documented (I also had issues with the ansible module). Not leaving a favorable impression of cloud-init, but I'm happy the issue is resolved. Thanks again for all your help!
72 replies
CCoder.com
Created by Mr_Neezer on 10/7/2022 in #help
Prevent destroying and recreating home volume on workspace update
My droplet is Debian 11, not Ubuntu, but possible its a related issue.
72 replies
CCoder.com
Created by Mr_Neezer on 10/7/2022 in #help
Prevent destroying and recreating home volume on workspace update
72 replies
CCoder.com
Created by Mr_Neezer on 10/7/2022 in #help
Prevent destroying and recreating home volume on workspace update
72 replies
CCoder.com
Created by Mr_Neezer on 10/7/2022 in #help
Prevent destroying and recreating home volume on workspace update
I tried merging the config docs from above with my mounts block, changing LABEL=${home_volume_label} to /dev/disk/by-id/scsi-0DO_Volume_${home_volume_name} (and making the supporting changes in main.tf), and now I'm back to the previous error:
Stderr: mount: /home/evan: wrong fs type, bad option, bad superblock on /dev/sda, missing codepage or helper program, or other error.
That seems like progress, since the last error was effectively "I can't find the volume!" and now it's like "This volume you gave me looks whack!" -- at least AFAICT
72 replies
CCoder.com
Created by Mr_Neezer on 10/7/2022 in #help
Prevent destroying and recreating home volume on workspace update
The DO dashboard does show the volume as being assigned to the droplet Coder created, though.
72 replies
CCoder.com
Created by Mr_Neezer on 10/7/2022 in #help
Prevent destroying and recreating home volume on workspace update
Hmm, maybe this is related? I tried running doctl projects resources list MY_DO_PROJECT_ID, and I see my domain (DNS), my kubernetes cluster, my droplet, and my hosted database... but no volumes. Maybe the volume isn't being correctly assigned to the DO project? Would that cause issues?
72 replies
CCoder.com
Created by Mr_Neezer on 10/7/2022 in #help
Prevent destroying and recreating home volume on workspace update
Seems to be the value of digitalocean_volume.home_volume.initial_filesystem_label
72 replies
CCoder.com
Created by Mr_Neezer on 10/7/2022 in #help
Prevent destroying and recreating home volume on workspace update
Ok, rebuilt using initial_filesystem_label (as y'all are doing in the do-linux example), and I'm still getting this error:
Stderr: mount: /home/evan: can't find LABEL=coder-home.
Thoughts?
72 replies
CCoder.com
Created by Mr_Neezer on 10/7/2022 in #help
Prevent destroying and recreating home volume on workspace update
Assuming the mounts are working as expected, of course.
72 replies