Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
tingweiwang
/
k8s
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 2c93de0f
authored
Aug 15, 2020
by
tingweiwang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update add_node.sh
1 parent
a9ba7a5b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
script/k8s/add_node.sh
script/k8s/add_node.sh
View file @
2c93de0
...
...
@@ -11,17 +11,17 @@ port=22
password
=
seetatech
for
ip
in
${
new_node
[@]
}
do
sshpass -p
$password
ssh-copy-id -i ~/.ssh/id_rsa.pub -p
$port
-o
StrictHostKeyChecking
=
no root@
$ip
sshpass -p
$password
ssh-copy-id -i ~/.ssh/id_rsa.pub -p
$port
-o
StrictHostKeyChecking
=
no root@
$ip
done
##############根据new_node节点清单自动配置ansible hosts########
for
ansible_new_node
in
${
new_node
[@]
}
do
if
! grep -qF
"
$ansible_new_node
"
/etc/hosts;
then
cat >>./hosts
<<EOF
$ip
EOF
else
echo
"您已配置该node:
$ip
信息到ansible hosts文件,已跳过该步骤"
fi
if
! grep -qF
"
$ansible_new_node
"
/etc/hosts;
then
cat >>./hosts
<<EOF
$ip
EOF
else
echo
"您已配置该node:
$ip
信息到ansible hosts文件,已跳过该步骤"
fi
done
########################################
ansible new_node -m script -a
"/root/k8s/script/k8s/backup/1-init.sh"
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment