2 Copyright 2020 Huawei Technologies Co., Ltd.
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
22 func EaltInstall(component string) error {
23 var strEaltSetup string
26 strEaltSetup = fmt.Sprintf("ansible-playbook ealt-all.yml -i ealt-inventory.ini --extra-vars \"operation=install\"")
28 strEaltSetup = fmt.Sprintf("ansible-playbook ealt-all.yml -i ealt-inventory.ini --tags \"infra\" --extra-vars \"operation=install\"")
30 strEaltSetup = fmt.Sprintf("ansible-playbook ealt-all.yml -i ealt-inventory.ini --tags \"mecm\" --extra-vars \"operation=install\"")
32 strEaltSetup = fmt.Sprintf("ansible-playbook ealt-all.yml -i ealt-inventory.ini --tags \"mep\" --extra-vars \"operation=install\"")
34 strEaltSetup = fmt.Sprintf("ansible-playbook ealt-all.yml -i ealt-inventory.ini --tags \"k8s\" --extra-vars \"operation=install\"")
36 strEaltSetup = fmt.Sprintf("ansible-playbook ealt-all.yml -i ealt-inventory.ini --tags \"k3s\" --extra-vars \"operation=install\"")
38 fmt.Println("Provide subcommand for ealt init [all|infra|manager|edge|k8s|k3s]")
41 stdout, err := runCommandAtShell(strEaltSetup)
49 func EaltReset(component string) error {
50 var strEaltReset string
54 strEaltReset = fmt.Sprintf("ansible-playbook ealt-all-uninstall.yml -i ealt-inventory.ini --extra-vars \"operation=uninstall\"")
56 strEaltReset = fmt.Sprintf("ansible-playbook ealt-all-uninstall.yml -i ealt-inventory.ini --tags \"infra\" --extra-vars \"operation=uninstall\"")
58 strEaltReset = fmt.Sprintf("ansible-playbook ealt-all-uninstall.yml -i ealt-inventory.ini --tags \"mecm\" --extra-vars \"operation=uninstall\"")
60 strEaltReset = fmt.Sprintf("ansible-playbook ealt-all-uninstall.yml -i ealt-inventory.ini --tags \"mep\" --extra-vars \"operation=uninstall\"")
62 strEaltReset = fmt.Sprintf("ansible-playbook ealt-all-uninstall.yml -i ealt-inventory.ini --tags \"k8s\" --extra-vars \"operation=uninstall\"")
64 strEaltReset = fmt.Sprintf("ansible-playbook ealt-all-uninstall.yml -i ealt-inventory.ini --tags \"k3s\" --extra-vars \"operation=uninstall\"")
66 fmt.Println("Provide subcommand for ealt clean [all|infra|manager|edge|k8s|k3s]")
69 stdout, err := runCommandAtShell(strEaltReset)