diff --git a/changelogs/fragments/90__add_ntp_var.yml b/changelogs/fragments/90__add_ntp_var.yml new file mode 100644 index 00000000..96be6212 --- /dev/null +++ b/changelogs/fragments/90__add_ntp_var.yml @@ -0,0 +1,4 @@ +--- +minor_changes: + - Add variable `provision_vcenter_vm_ntp_server` to handle ntp server + - Set default value of `time.nist.gov` diff --git a/roles/provision_vcenter/README.md b/roles/provision_vcenter/README.md index 17bf12af..779ae823 100644 --- a/roles/provision_vcenter/README.md +++ b/roles/provision_vcenter/README.md @@ -81,6 +81,9 @@ pyvomi - **provision_vcenter_vm_network_dns**: - list(str), A list of DNS servers the vcenter vm should use. Required if network mode is set to 'static'. +- **provision_vcenter_vm_ntp_server**: + - str or int, Server to use for NTP source. + - **provision_vcenter_vm_network_ip_family**: - str, The IP family that the VM should use for its network. ipv4 or ipv6. Default is ipv4 diff --git a/roles/provision_vcenter/defaults/main.yml b/roles/provision_vcenter/defaults/main.yml index 7987f19b..b8a071fb 100644 --- a/roles/provision_vcenter/defaults/main.yml +++ b/roles/provision_vcenter/defaults/main.yml @@ -5,3 +5,4 @@ provision_vcenter_vm_enable_ssh: true provision_vcenter_vm_enable_ceip: false provision_vcenter_iso_mount_point: /tmp/vcenter_iso provision_vcenter_vm_network_ip_family: ipv4 +provision_vcenter_vm_ntp_server: time.nist.gov diff --git a/roles/provision_vcenter/templates/config_parts/vm.j2 b/roles/provision_vcenter/templates/config_parts/vm.j2 index 0f6f2347..9068bae3 100644 --- a/roles/provision_vcenter/templates/config_parts/vm.j2 +++ b/roles/provision_vcenter/templates/config_parts/vm.j2 @@ -26,5 +26,5 @@ "os": { "password": "{{ provision_vcenter_vm_password }}", "ssh_enable": {{ provision_vcenter_vm_enable_ssh | bool | to_json }}, - "ntp_servers": "time.nist.gov" + "ntp_servers": "{{ provision_vcenter_vm_ntp_server }}" }