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 [2017/12/31 23:22] kurihara |
middleware:squid:index.html [2019/02/11 00:46] (current) kurihara |
||
---|---|---|---|
Line 2: | Line 2: | ||
====== Squid (squid.py) ====== | ====== Squid (squid.py) ====== | ||
+ | $FHHOME/ | ||
- | \\ | ||
{{INLINETOC}} | {{INLINETOC}} | ||
\\ | \\ | ||
- | ===== Operation ===== | + | ===== Squid Operation ===== |
<sxh bash toolbar: | <sxh bash toolbar: | ||
- | $ echo a |fab -l |grep squid | + | $ fab -l |grep squid |
- | + | </ | |
- | $ echo xx.xx.xx.xx | fab | + | |
- | $ echo xx.xx.xx.xx | fab | + | <sxh bash toolbar: |
+ | $ fab -H x.x.x.x | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | ==== Fabric Temporary Run Call Examples ==== | ||
+ | <sxh bash toolbar: | ||
+ | $ H=test-serve-01, | ||
+ | |||
+ | $ fab -H $H -- sudo diff /etc/squid/squid.conf / | ||
+ | $ fab -H $H -- sudo mv / | ||
+ | |||
+ | $ fab -H $H -- "ps aux |grep suqid" | ||
+ | $ fab -H $H -- sudo systemctl status squid | ||
+ | $ fab -H $H -- sudo systemctl restart squid | ||
</ | </ | ||
Line 20: | Line 34: | ||
$FHHOME/ | $FHHOME/ | ||
+ | <sxh bash toolbar: | ||
+ | import sys, os | ||
+ | from fabric.api import * | ||
+ | from fabric.contrib import files | ||
+ | |||
+ | FHHOME=os.environ[" | ||
+ | |||
+ | # | ||
+ | # Installing Squid | ||
+ | # | ||
+ | # squid.install_yum | ||
+ | @task | ||
+ | def install_yum(): | ||
+ | sudo(" | ||
+ | |||
+ | # | ||
+ | # Service | ||
+ | # | ||
+ | # squid.systemctl_restart | ||
+ | @task | ||
+ | def systemctl_restart(): | ||
+ | run(" | ||
+ | sudo(" | ||
+ | sudo(" | ||
+ | sudo(" | ||
+ | run(" | ||
+ | |||
+ | # | ||
+ | # Configuration | ||
+ | # | ||
+ | # squid.change_squidconf: | ||
+ | @task | ||
+ | def change_squidconf(host): | ||
+ | today = datetime.now().strftime(' | ||
+ | sudo(" | ||
+ | put(" | ||
+ | sudo(" | ||
+ | |||
+ | </ | ||
\\ | \\ | ||
- | ===== Configuration ===== | + | ===== Squid Configuration |
+ | *[[middleware: | ||
*[[middleware: | *[[middleware: | ||
My Sites
SNS
Copyright (c) 2025 FastHandle - IT Operations Examples All Rights Reserved.