You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use this module to configure a pritunl_server on dynamic ec2, this worked on first launch!
I think it worked because pritunl assumes if the pritunl_server host_ids field is empty, to use all current hosts, however that host quickly has been terminated and replaced with a new host with the same ip address, and now the pritunl_server definition is broken and tf has no plan to fix it.
I have repaired this by hand for the last few weeks, it becomes broken every time this reprovision happens. The reprovision happens due to a different ami id from a data provider filter, and that change forces the aws_instance to be replaced, and that generates a new unknown pritunl_host hostname. Dealing with it in terraform is an option for this here i think, but I also think there is no way to solve this without a change in this data provider.
Looking into it, at one point here, we have all the host information in memory, which is encouraging, seems like this is really close to being nearly a cosmetic change!
Can we expose the full pritunl_host result set?
This would enable me to filter it in hcl expressions.
Can we expose the full pritunl host data for each host in the host set?
Without more data than just hostname and id, I have no way to test which hosts are online and would probably remain stuck.
With a full list of host objects, populated with the full api data from pritunl (example below) I could have filtered the data I needed with a terraform expression and (maybe) been done fixing this dynamic inventory incompatibility.
Are there other ways to work around this limitation? If i could know the generated pritunl_host hostname ahead of committing the hcl, maybe I could explicitly query the data I need. Presently, the data provider has to way I understand to query the list of hostnames that exist, so by definition can't query any pritunl_host data unless I describe them from the pritunl api out of band of this provider, which maybe I could do with a presumptuous curl/wget shell out, would really prefer not to.
maybe I misunderstand: without having the full list of pritunl-generated host names, how can we write a query for a specific hostname? No way to get that string, can only ask for data about a specific string.
Is there some way to request a pritunl server instance use a specific hostname? I looked at the generated /etc/pritunl.conf and there is no setting for server hostname it seems, so i think these strings are just, generated only, so I feel pretty stuck here and confused how this could be used at all.
In case it helps, here is some sample data, with unique values replaced with fake data
for my own needs, I think I need the cross section of status="online" and availability_group="default", and then from that cross section resource.pritunl_server.host_ids = [for i in data.pritunl_host : i.id]
presently, I see no way to get there with the source as is.
Thanks for your attention, I am comfortable proposing some edits to the source with your blessing, so lmk, is there a specific way this case should be dealt with, presumably backwards compatibility is a big deal, and I think the existing provider's hostname requirement makes changing this provider may be complicated to keep backwards compat.
The text was updated successfully, but these errors were encountered:
looking into work arounds, digging into the pritunl source, shows that there is no hostname setting, but there is a host_id setting which is the actual unique id (as a uuid) of the pritunl_host, this information can be generated in advance of the instance starting, and specifying it can bypass the need to use data pritunl_host since this is the literal value to provide to pritunl_server host_id's as is.
Hello,
I was trying to use this module to configure a pritunl_server on dynamic ec2, this worked on first launch!
I think it worked because pritunl assumes if the pritunl_server host_ids field is empty, to use all current hosts, however that host quickly has been terminated and replaced with a new host with the same ip address, and now the pritunl_server definition is broken and tf has no plan to fix it.
I have repaired this by hand for the last few weeks, it becomes broken every time this reprovision happens. The reprovision happens due to a different ami id from a data provider filter, and that change forces the aws_instance to be replaced, and that generates a new unknown pritunl_host hostname. Dealing with it in terraform is an option for this here i think, but I also think there is no way to solve this without a change in this data provider.
Looking into it, at one point here, we have all the host information in memory, which is encouraging, seems like this is really close to being nearly a cosmetic change!
terraform-provider-pritunl/internal/provider/data_source_host.go
Line 49 in 7510b81
This would enable me to filter it in hcl expressions.
Without more data than just hostname and id, I have no way to test which hosts are online and would probably remain stuck.
With a full list of host objects, populated with the full api data from pritunl (example below) I could have filtered the data I needed with a terraform expression and (maybe) been done fixing this dynamic inventory incompatibility.
Are there other ways to work around this limitation? If i could know the generated pritunl_host hostname ahead of committing the hcl, maybe I could explicitly query the data I need. Presently, the data provider has to way I understand to query the list of hostnames that exist, so by definition can't query any pritunl_host data unless I describe them from the pritunl api out of band of this provider, which maybe I could do with a presumptuous curl/wget shell out, would really prefer not to.
maybe I misunderstand: without having the full list of pritunl-generated host names, how can we write a query for a specific hostname? No way to get that string, can only ask for data about a specific string.
Is there some way to request a pritunl server instance use a specific hostname? I looked at the generated
/etc/pritunl.conf
and there is no setting for server hostname it seems, so i think these strings are just, generated only, so I feel pretty stuck here and confused how this could be used at all.In case it helps, here is some sample data, with unique values replaced with fake data
for my own needs, I think I need the cross section of
status="online" and availability_group="default"
, and then from that cross sectionresource.pritunl_server.host_ids = [for i in data.pritunl_host : i.id]
presently, I see no way to get there with the source as is.
Thanks for your attention, I am comfortable proposing some edits to the source with your blessing, so lmk, is there a specific way this case should be dealt with, presumably backwards compatibility is a big deal, and I think the existing provider's hostname requirement makes changing this provider may be complicated to keep backwards compat.
The text was updated successfully, but these errors were encountered: