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/11/27 00:38] kurihara |
middleware:squid:index.html [2019/02/11 00:46] (current) kurihara |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ~~NOTOC~~ | + | [[: |
- | ====== Squid ====== | + | ====== Squid (squid.py) |
+ | $FHHOME/ | ||
+ | {{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 pro squid.yum_install | + | |
- | $ echo xx.xx.xx.xx | fab stg httpd. | + | |
</ | </ | ||
+ | <sxh bash toolbar: | ||
+ | $ fab -H x.x.x.x | ||
+ | </ | ||
\\ | \\ | ||
- | ===== squid.py | + | ==== Fabric |
+ | <sxh bash toolbar: | ||
+ | $ H=test-serve-01, | ||
+ | $ fab -H $H -- sudo diff / | ||
+ | $ 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 | ||
+ | </ | ||
\\ | \\ | ||
- | ===== Configuration ===== | + | ===== squid.py ===== |
+ | $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(" | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | \\ | ||
+ | ===== Squid Configuration | ||
+ | *[[middleware: | ||
*[[middleware: | *[[middleware: | ||
+ | \\ | ||
+ | \\ | ||
+ | <WRAP box 90%> | ||
+ | <catlist ..: -noAddPageButton -smallHead -sortAscending> | ||
+ | </ | ||
+ | \\ | ||
+ | [[: |
My Sites
SNS
Copyright (c) 2025 FastHandle - IT Operations Examples All Rights Reserved.