FastHandle is fast operation tools for infrastructure configurations and tests.
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
middleware:squid:index.html [2018/01/07 01:14] kurihara [squid.py] |
middleware:squid:index.html [2019/02/11 00:46] (current) kurihara |
||
|---|---|---|---|
| Line 13: | Line 13: | ||
| <sxh bash toolbar: | <sxh bash toolbar: | ||
| - | $ fab -H x.x.x.x | + | $ fab -H x.x.x.x |
| </ | </ | ||
| + | \\ | ||
| + | ==== Fabric Temporary Run Call Examples ==== | ||
| <sxh bash toolbar: | <sxh bash toolbar: | ||
| $ H=test-serve-01, | $ H=test-serve-01, | ||
| - | $ fab -H $H auth.pro | + | $ fab -H $H -- sudo diff / |
| - | $ fab -H $H auth.pro | + | $ fab -H $H -- sudo mv / |
| - | $ fab -H $H auth.pro | + | $ fab -H $H -- "ps aux |grep suqid" |
| - | $ fab -H $H auth.pro | + | $ fab -H $H -- sudo systemctl status squid |
| - | $ fab -H $H auth.pro | + | $ fab -H $H -- sudo systemctl restart squid |
| </ | </ | ||
| Line 33: | Line 35: | ||
| <sxh bash toolbar: | <sxh bash toolbar: | ||
| - | import sys | + | import sys, os |
| from fabric.api import * | from fabric.api import * | ||
| from fabric.contrib import files | from fabric.contrib import files | ||
| Line 62: | Line 64: | ||
| # Configuration | # Configuration | ||
| # | # | ||
| - | # squid.conf | + | # squid.change_squidconf: |
| - | @task | + | |
| - | def put_today_conf(): | + | |
| - | today = datetime.now().strftime(' | + | |
| - | put(" | + | |
| - | sudo(" | + | |
| - | sudo("/ | + | |
| @task | @task | ||
| - | def change_today_conf(): | + | def change_squidconf(host): |
| today = datetime.now().strftime(' | today = datetime.now().strftime(' | ||
| sudo(" | sudo(" | ||
| - | put(" | + | put(" |
| - | sudo("chown root:squid / | + | sudo("mv /tmp/squid.conf.%s |
| </ | </ | ||
| Line 81: | Line 76: | ||
| \\ | \\ | ||
| - | ===== Configuration ===== | + | ===== Squid Configuration |
| + | *[[middleware: | ||
| *[[middleware: | *[[middleware: | ||
My Sites
SNS
Copyright (c) 2025 FastHandle - IT Operations Examples All Rights Reserved.