Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Thomas Capricelli
botfreak
Commits
18303b2073e2
Commit
51c37a77
authored
Jul 27, 2022
by
Thomas Capricelli
Browse files
formatting
parent
14171907de3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
fabfile.py
View file @
18303b20
...
...
@@ -70,7 +70,7 @@ def restart_daemons(c):
c
.
run
(
"uname -a"
)
c
.
run
(
"supervisorctl restart botfreak-blocker-ipset"
,
pty
=
False
)
c
.
run
(
"supervisorctl restart botfreak-watcher"
,
pty
=
False
)
print
(
"Finished at"
+
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d %H:%M"
))
print
(
"Finished at
"
+
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d %H:%M"
))
@
task
(
hosts
=
daemons_hosts
)
def
clear_daemons
(
c
):
...
...
@@ -79,7 +79,7 @@ def clear_daemons(c):
c
.
run
(
"uname -a"
)
c
.
run
(
"ipset flush botfreak-ipv4"
,
pty
=
False
)
c
.
run
(
"ipset flush botfreak-ipv6"
,
pty
=
False
)
print
(
"Finished at"
+
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d %H:%M"
))
print
(
"Finished at
"
+
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d %H:%M"
))
@
task
(
hosts
=
web_hosts
)
...
...
@@ -87,21 +87,21 @@ def deploy_web(c):
"Update and restart the web server"
update_web
(
c
)
restart_web
(
c
)
print
(
"Finished at"
+
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d %H:%M"
))
print
(
"Finished at
"
+
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d %H:%M"
))
@
task
(
hosts
=
daemons_hosts
)
def
deploy_daemons
(
c
):
"Update and restart daemons"
update_daemons
(
c
)
restart_daemons
(
c
)
print
(
"Finished at"
+
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d %H:%M"
))
print
(
"Finished at
"
+
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d %H:%M"
))
@
task
(
hosts
=
daemons_hosts
)
def
reinit_daemons
(
c
):
"Clear all ipsets lists and restart the daemon to fill them cleanly"
clear_daemons
(
c
)
restart_daemons
(
c
)
print
(
"Finished at"
+
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d %H:%M"
))
print
(
"Finished at
"
+
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d %H:%M"
))
@
task
()
def
deploy
(
c
):
...
...
@@ -110,7 +110,7 @@ def deploy(c):
restart_web
(
c
)
update_daemons
(
c
)
restart_daemons
(
c
)
print
(
"Finished at"
+
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d %H:%M"
))
print
(
"Finished at
"
+
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d %H:%M"
))
# vim: ai ts=4 sts=4 et sw=4
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