update runPlaybook function

This commit is contained in:
2024-04-26 00:12:54 +03:00
parent f25a1c3364
commit 896e27fc1f
3 changed files with 6 additions and 8 deletions

View File

@@ -1,16 +1,13 @@
package kubespray
func InstallCluster(tags string) {
ansiblePlaybookOptions := getPlaybookParameters(tags)
runPlaybook("kubespray/project/cluster.yml", ansiblePlaybookOptions)
runPlaybook("kubespray/project/cluster.yml", tags)
}
func UpgradeCluster(tags string) {
ansiblePlaybookOptions := getPlaybookParameters(tags)
runPlaybook("kubespray/project/upgrade_cluster.yml", ansiblePlaybookOptions)
runPlaybook("kubespray/project/upgrade_cluster.yml", tags)
}
func ResetCluster() {
ansiblePlaybookOptions := getPlaybookParameters("reset")
runPlaybook("kubespray/project/reset.yml", ansiblePlaybookOptions)
runPlaybook("kubespray/project/reset.yml", "reset")
}

View File

@@ -55,7 +55,8 @@ func CopyK8SAdminConfig(pathInDataDir string) {
}
}
func runPlaybook(playbookPath string, playbookOptions playbook.AnsiblePlaybookOptions) {
func runPlaybook(playbookPath string, tags string) {
playbookOptions := getPlaybookParameters(tags)
playbookCmd := playbook.NewAnsiblePlaybookCmd(
playbook.WithPlaybooks(playbookPath),
playbook.WithPlaybookOptions(&playbookOptions),