GithubHelp home page GithubHelp logo

Comments (5)

dlethin avatar dlethin commented on July 30, 2024

I've got a draft PR in my fork that I worked on yesterday that works for my needs. I'll find some time to clean it up and submit a PR here.

It allows me to have a project looking like this -- essentially adding support for the virtual_network_route block:

resource "pritunl_server" "test" {
  name="terraform_test"

  groups = []

  # todo = convert this to a data resource lookup
  organization_ids = [
    "[REDACTED]"
  ]

  host_ids = [for host in local.host_names:
    data.pritunl_host.host[host].id
  ]

  network = "172.20.68.0/24"
  port = 20068
  cipher             = "aes256"
  dns_servers        = [
    "10.20.0.2",
    "9.9.9.9",
  ]

  # This block is new, allowing me to ensure the server's network is updated in our VPC to
  # always point to the active pritunl host for this server.
  virtual_network_route {
    cloud_advertise = true
  }

  route {
     network =     "10.20.0.2/32"
     nat = false
  }
}

from terraform-provider-pritunl.

dlethin avatar dlethin commented on July 30, 2024

On challenge I ran into when testing my changes on our existing infrastructure via terraform import, is that pritunl used to use the vpc_id field to mark whether a route was marked as cloud_advertise. So I've got a few routes in that situation where advertise is not set for vpc_id is.
I tried to account for that in this change here -- dlethin@bc81442#diff-3f3aaab5413458017dfa169b2579db2467bc64be78ba8f86a84872472e6c1e32R618

But I don't know if its great to have the provider try to manage changes like this. Maybe the expectation might be that the user cleans up there installation prior to trying to use this plugin?

Cuirious if anyone has thoughts on this?

from terraform-provider-pritunl.

dlethin avatar dlethin commented on July 30, 2024

I had another discussion with pritunl developer and it seems that when terraform provider wants to update a route to turn cloud_advertise off, we only need to set advertise to false, and the server will handle setting unsetting vpc_id.
That makes this problem easier. The only thing we need to do is marke cloud_advertise as true if either advertise is set or vpc_id is not empty.

from terraform-provider-pritunl.

disc avatar disc commented on July 30, 2024

Hey @dlethin, why did you close your draft PR with cloud_advertise feature?
Have you faced with some issues with it?
Have this PR solved your issue?
dlethin#1

from terraform-provider-pritunl.

dlethin avatar dlethin commented on July 30, 2024

Hi there -- Quite frankly, I don't remember why I had closed it back then -- I'm not a native golang developer and wasn't really reaching critical momentum getting this to work I was doing this in my spare time but other priorities arose and I completely stopped working on this. It's been so long I've forgotten all the context behind this, but if you are actively working on this I can try to offer some help in this area.

from terraform-provider-pritunl.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.