1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 23:04:41 +00:00

Merge pull request #2175 from niusmallnan/issues-2168

Only enable open-vm-tools serivce for vmware
This commit is contained in:
niusmallnan
2017-12-13 10:46:51 +08:00
committed by GitHub

View File

@@ -486,23 +486,25 @@ func enableHypervisorService(cfg *config.CloudConfig, hypervisorName string) {
return return
} }
// only enable open-vm-tools for vmware
// these services(xenhvm-vm-tools, kvm-vm-tools, hyperv-vm-tools and bhyve-vm-tools) don't exist yet
if hypervisorName == "vmware" { if hypervisorName == "vmware" {
hypervisorName = "open" hypervisorName = "open"
} serviceName := hypervisorName + "-vm-tools"
serviceName := hypervisorName + "-vm-tools" if !cfg.Rancher.HypervisorService {
if !cfg.Rancher.HypervisorService { log.Infof("Skipping %s as `rancher.hypervisor_service` is set to false", serviceName)
log.Infof("Skipping %s as `rancher.hypervisor_service` is set to false", serviceName) return
return }
}
// Check removed - there's an x509 cert failure on first boot of an installed system // Check removed - there's an x509 cert failure on first boot of an installed system
// check quickly to see if there is a yml file available // check quickly to see if there is a yml file available
// if service.ValidService(serviceName, cfg) { // if service.ValidService(serviceName, cfg) {
log.Infof("Setting rancher.services_include. %s=true", serviceName) log.Infof("Setting rancher.services_include. %s=true", serviceName)
if err := config.Set("rancher.services_include."+serviceName, "true"); err != nil { if err := config.Set("rancher.services_include."+serviceName, "true"); err != nil {
log.Error(err) log.Error(err)
}
// } else {
// log.Infof("Skipping %s, can't get %s.yml file", serviceName, serviceName)
// }
} }
// } else {
// log.Infof("Skipping %s, can't get %s.yml file", serviceName, serviceName)
// }
} }