mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
region: lbagent: undeploy: make it idempotent
Both the following three can result in the same error message "Could not find the requested service yunion-xx: host" -m systemd -a 'name=yunion-xx enabled=no state=stopped daemon_reload=yes' -m systemd -a 'name=yunion-xx enabled=no state=stopped daemon_reload=yes force=yes' -m service -a 'name=yunion-xx enabled=no state=stopped' Use of ansibleplaybookv2 is overkill and can break console expectation. Just turn to shell module for now
This commit is contained in:
@@ -216,12 +216,9 @@ func (lbagent *SLoadbalancerAgent) undeploy(ctx context.Context, userCred mcclie
|
||||
},
|
||||
Modules: []ansible.Module{
|
||||
{
|
||||
Name: "systemd",
|
||||
Name: "shell",
|
||||
Args: []string{
|
||||
"name=yunion-lbagent",
|
||||
"enabled=no",
|
||||
"state=stopped",
|
||||
"daemon_reload=yes",
|
||||
"systemctl disable --now yunion-lbagent; true",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user