Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Rainbond2
Commits
d4b4b6d7
Commit
d4b4b6d7
authored
5 years ago
by
barnett
Browse files
Options
Download
Email Patches
Plain Diff
change ansible host state judgment
parent
693eade0
main
Develop-V5.X
V5.1
V5.2
V5.3
V5.4
dependabot/npm_and_yarn/webcli/js/xterm-4.5.0
feat-V5.10
feat-V5.10.1
feat-containerd
feat-containerd1
feature-helmapp
feature-helmapp-2
feature-k8s
fixbug-560
master
mesh-start
servicemonitor
zqhtest-containerd
v5.10.0-release
v5.9.0-release
v5.8.1-release
v5.8.0-release
v5.7.1-release
v5.7.0-release
v5.6.0-release
v5.5.0-release
v5.5.0-dind
v5.4.1-release
v5.4.0-release
v5.3.3-release
v5.3.2-release
v5.3.1-release
v5.3.0-release
v5.2.2-release
v5.2.1-release
v5.2.0-release
v5.2.0-beta2
v5.2.0-beta1
v5.1.11-release
v5.1.10-release
v5.1.9-release
v5.1.8-release
v5.1.6-release
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
util/ansible/ansible.go
+6
-3
util/ansible/ansible.go
with
6 additions
and
3 deletions
+6
-3
util/ansible/ansible.go
+
6
-
3
View file @
d4b4b6d7
...
...
@@ -192,8 +192,11 @@ func (c *HostConfig) AddHost(h *client.HostNode, installConfPath string) {
AnsibleSSHPrivateKeyFile
:
h
.
KeyPath
,
}
c
.
GroupList
[
"all"
]
.
AddHost
(
ansibleHost
)
checkNeedInstall
:=
func
(
h
*
client
.
HostNode
)
bool
{
return
h
.
Status
==
client
.
NotInstalled
||
h
.
Status
==
client
.
InstallFailed
||
h
.
Status
==
client
.
Installing
}
if
h
.
Role
.
HasRule
(
"manage"
)
{
if
h
.
Status
==
client
.
NotInstalled
||
h
.
Status
==
client
.
Install
Failed
{
if
checkNeed
Install
(
h
)
{
c
.
GroupList
[
"new-manage"
]
.
AddHost
(
ansibleHost
)
}
else
{
c
.
GroupList
[
"manage"
]
.
AddHost
(
ansibleHost
)
...
...
@@ -203,14 +206,14 @@ func (c *HostConfig) AddHost(h *client.HostNode, installConfPath string) {
}
}
if
h
.
Role
.
HasRule
(
"compute"
)
{
if
h
.
Status
==
client
.
NotInstalled
||
h
.
Status
==
client
.
Install
Failed
{
if
checkNeed
Install
(
h
)
{
c
.
GroupList
[
"new-compute"
]
.
AddHost
(
ansibleHost
)
}
else
{
c
.
GroupList
[
"compute"
]
.
AddHost
(
ansibleHost
)
}
}
if
h
.
Role
.
HasRule
(
"gateway"
)
{
if
h
.
Status
==
client
.
NotInstalled
||
h
.
Status
==
client
.
Install
Failed
{
if
checkNeed
Install
(
h
)
{
c
.
GroupList
[
"new-gateway"
]
.
AddHost
(
ansibleHost
)
}
else
{
c
.
GroupList
[
"gateway"
]
.
AddHost
(
ansibleHost
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help