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

Add support to manage ntpd setting on ESXi hosts #1131

Open
waquidvp opened this issue Jul 10, 2020 · 0 comments · May be fixed by #2232
Open

Add support to manage ntpd setting on ESXi hosts #1131

waquidvp opened this issue Jul 10, 2020 · 0 comments · May be fixed by #2232
Labels
acknowledged Status: Issue or Pull Request Acknowledged area/host Area: Host enhancement Type: Enhancement size/s Relative Sizing: Small
Milestone

Comments

@waquidvp
Copy link
Contributor

Description

We are trying configure ntp on all of our ESXi hosts. This is currently available in the govc cli, see this. We want to have the ability to both enable the ntpd service and later configure it.

We had a look at the provider source code and adding this feature doesn't look trivial. I am happy to create a PR for this feature but I am unsure about where to start. Since it involves both exposing the ServiceSystem for controlling the different services (in our case, ntpd) and the DateTimeSystem for configuring the ntpd service, could we add these under the vsphere_host resource or in a new resource, eg. vsphere_host_services and vsphere_host_ntp?

We can see some examples of how ConfigManager is used in vsphere/resource_vsphere_host.go but we can't find any uses of ServiceSystem so some guidance would be much appreciated.

For now we are using govc and could potentially have it as a null_resource.

Potential Terraform Configuration

data "vsphere_datacenter" "dc" {
  name = "my-datacenter"
}

resource "vsphere_host" "h1" {
  hostname   = "10.10.10.1"
  username   = "root"
  password   = "password"
  license    = "00000-00000-00000-00000i-00000"
  datacenter = data.vsphere_datacenter.dc.id
  services   = {
    ntpd = {
      enabled     = true
      policy      = "on"
      ntp_servers = [
        "0.pool.ntp.org",
        "1.pool.ntp.org"
      ]
    }
  }
}

or

data "vsphere_datacenter" "dc" {
  name = "my-datacenter"
}

resource "vsphere_host" "h1" {
  hostname   = "10.10.10.1"
  username   = "root"
  password   = "password"
  license    = "00000-00000-00000-00000i-00000"
  datacenter = data.vsphere_datacenter.dc.id
}

resource "vsphere_host_service" "ntp" {
  service = "ntpd"
  enabled = true
  policy = "on"
  ntp_servers = [
     "0.pool.ntp.org",
     "1.pool.ntp.org"
  ]
}

References

This feature is available in Ansible, but we prefer to use Terraform ❤️:

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@waquidvp waquidvp added the enhancement Type: Enhancement label Jul 10, 2020
@bill-rich bill-rich added size/s Relative Sizing: Small acknowledged Status: Issue or Pull Request Acknowledged labels Jul 14, 2020
@tenthirtyam tenthirtyam changed the title Configure ntpd service on the vSphere host Add support to manage ntpd setting on ESXi hosts Feb 4, 2022
@tenthirtyam tenthirtyam added the area/host Area: Host label Feb 22, 2022
@tenthirtyam tenthirtyam added this to the v2.2.0 milestone Feb 24, 2022
@tenthirtyam tenthirtyam modified the milestones: v2.2.0, Backlog Mar 20, 2022
@burnsjared0415 burnsjared0415 linked a pull request Jul 2, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledged Status: Issue or Pull Request Acknowledged area/host Area: Host enhancement Type: Enhancement size/s Relative Sizing: Small
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants