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

@@ -1961,7 +1961,7 @@ releases:
server.insecure: true server.insecure: true
secret: secret:
argocdServerAdminPassword: $2a$10$vyI/s19oGdrz9rtPVKsZeuXIdPhQQcUzNcn/soL160xBFmvraA3Za argocdServerAdminPassword: $2a$10$uVEAEmc8bmtQYsa3206a7OkI5oHkNWluS9s5szXsNUsgmKvY2jGZy
repositories: repositories:
# add default helm-repository from harbor # add default helm-repository from harbor

View File

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

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( playbookCmd := playbook.NewAnsiblePlaybookCmd(
playbook.WithPlaybooks(playbookPath), playbook.WithPlaybooks(playbookPath),
playbook.WithPlaybookOptions(&playbookOptions), playbook.WithPlaybookOptions(&playbookOptions),