Skip to content

Commit

Permalink
超时时间过短的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
shaohq committed Jan 16, 2022
1 parent 2be4ce4 commit 7fe5d4b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions server/ansible-script/ansible-adhoc.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ roles_path = ./roles:$VIRTUAL_ENV/usr/local/share/kubespray/roles:$VIRTUAL_ENV/u
deprecation_warnings=False
inventory_ignore_extensions = ~, .orig, .bak, .ini, .cfg, .retry, .pyc, .pyo, .creds, .gpg

forks=100
force_color=False

interpreter_python=auto
Expand Down
4 changes: 2 additions & 2 deletions server/api/cluster/state/ping_pong.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ func PingPong(clusterName string, nodes string) (*PingPongResult, error) {
// "--timeout", "20",
"-e", "kuboardspray_cluster_dir=" + constants.GET_DATA_DIR() + "/cluster/" + clusterName,
},
Env: []string{"ANSIBLE_CONFIG=" + constants.GET_ADHOC_CFG_PATH()},
Timeout: 20,
Env: []string{"ANSIBLE_CONFIG=" + constants.GET_ADHOC_CFG_PATH()},
// Timeout: 20,
// Dir: resourcePackageDir,
}
stdout, stderr, err := cmd.Run()
Expand Down
8 changes: 4 additions & 4 deletions server/api/fact/facts.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ func nodefacts(req GetNodeFactRequest) (*gin.H, error) {
defer os.Remove(inventoryPath)

run := command.Run{
Cmd: "ansible",
Args: []string{req.Node, "-m", "setup", "-i", inventoryPath},
Env: []string{"ANSIBLE_CONFIG=" + constants.GET_ADHOC_CFG_PATH()},
Timeout: 5,
Cmd: "ansible",
Args: []string{req.Node, "-m", "setup", "-i", inventoryPath},
Env: []string{"ANSIBLE_CONFIG=" + constants.GET_ADHOC_CFG_PATH()},
// Timeout: 5,
// Dir: dir + "/ansible-script",
}

Expand Down

0 comments on commit 7fe5d4b

Please sign in to comment.