Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
9a6308e4
Commit
9a6308e4
authored
Mar 13, 2017
by
Oceans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update leave
parent
3f57da61
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
docker_swarm.py
drip-deployer/docker_swarm.py
+4
-0
No files found.
drip-deployer/docker_swarm.py
View file @
9a6308e4
...
@@ -25,6 +25,8 @@ def install_manager(vm):
...
@@ -25,6 +25,8 @@ def install_manager(vm):
ssh
=
paramiko
.
SSHClient
()
ssh
=
paramiko
.
SSHClient
()
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
)
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
)
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo docker swarm leave --force"
)
stdout
.
read
()
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo docker swarm init --advertise-addr eth0"
)
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo docker swarm init --advertise-addr eth0"
)
retstr
=
stdout
.
readlines
()
retstr
=
stdout
.
readlines
()
print
"
%
s: ========= Swarm Manager Installed ========="
%
(
vm
.
ip
)
print
"
%
s: ========= Swarm Manager Installed ========="
%
(
vm
.
ip
)
...
@@ -40,6 +42,8 @@ def install_worker(join_cmd, vm):
...
@@ -40,6 +42,8 @@ def install_worker(join_cmd, vm):
ssh
=
paramiko
.
SSHClient
()
ssh
=
paramiko
.
SSHClient
()
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
)
ssh
.
connect
(
vm
.
ip
,
username
=
vm
.
user
,
key_filename
=
vm
.
key
)
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo docker swarm leave --force"
)
stdout
.
read
()
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo
%
s"
%
(
join_cmd
))
stdin
,
stdout
,
stderr
=
ssh
.
exec_command
(
"sudo
%
s"
%
(
join_cmd
))
stdout
.
read
()
stdout
.
read
()
print
"
%
s: ========= Swarm Worker Installed ========="
%
(
vm
.
ip
)
print
"
%
s: ========= Swarm Worker Installed ========="
%
(
vm
.
ip
)
...
...
Write
Preview
Markdown
is supported
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