natemccurdy / puppet-pe_install_ps1

Automate your puppet agent installs on Windows nodes
Apache License 2.0
0 stars 4 forks source link

add time services support #15

Closed trevharmon closed 8 years ago

trevharmon commented 8 years ago

This commit uses the W32tm service to sync the clock of the system. It does require the current time be within a certain range, otherwise it will complain and ask for manual intervention.

The service is stopped, the new setting are applied, and then a time sync is forced once the service has been restarted. If this fails, the script waits several seconds and then retries the action. If it fails a second time, the script aborts with an error message.

trevharmon commented 8 years ago

Contains all changes of PR #14

natemccurdy commented 8 years ago

Please rebase off of master now that the cleanup PR has been merged.

natemccurdy commented 8 years ago

@trevharmon To keep the footprint of this script as low as possible by default, can you restructure the code such that configuring NTP is disabled by default?

trevharmon commented 8 years ago

Configuring NTP is now disabled by default via the set_ntp_servers parameter.

natemccurdy commented 8 years ago

@trevharmon So, after thinking about your PR's, I've come to the conclusion that the logic to set DNS or NTP should be handled by flags to the powershell script; they should not be configured by parameters to the Puppet code.

By making these parameters to Puppet code, the powershell script can only ever be used in one way. This is not ideal in the case where you want to install the Puppet agent on many Windows boxes where some might need DNS, some might need NTP, some might need both, and some might need none.

If you think you can rewrite the Powershell to handle all the logic, then please submit a new PR to do so. If not, I think this is a good feature, and I will try to implement it myself.

Let me know what you think. I'm planning on closing this PR and #16 as well, but I'll keep them open for a bit to have a place to converse.

trevharmon commented 8 years ago

Will resubmit PR once it's cleaned up.

natemccurdy commented 8 years ago

Sounds good @trevharmon 👍 Thanks for working on this.

trevharmon commented 8 years ago

See #17