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 | ||
os:linux:user:index.html [2018/02/14 00:30] kurihara |
os:linux:user:index.html [2019/02/11 00:39] (current) kurihara |
||
---|---|---|---|
Line 7: | Line 7: | ||
\\ | \\ | ||
- | ===== Operation ===== | + | ===== Operation |
==== print list of possible commands ==== | ==== print list of possible commands ==== | ||
Line 34: | Line 34: | ||
<sxh bash toolbar: | <sxh bash toolbar: | ||
- | $ fab -H $H auth.pro | + | $ fab -H $H |
- | $ echo x.x.x.x | fab | + | $ echo x.x.x.x | fab user.check_user: |
</ | </ | ||
- | ==== Ref. Remote Shell Commands | + | ==== Fabric one-line Task Examples==== |
<sxh bash toolbar: | <sxh bash toolbar: | ||
$ H=test-server-1 | $ H=test-server-1 | ||
- | $ fab -H $H auth.pro | + | $ fab -H $H -- hostname |
- | $ fab -H $H auth.pro | + | $ fab -H $H -- id user01 |
- | $ fab -H $H auth.pro | + | $ fab -H $H -- "cat /etc/passwd |grep user01" |
- | $ fab -H $H auth.pro | + | $ fab -H $H -- grep user01 /etc/group |
- | $ fab -H $H auth.pro | + | $ fab -H $H -- sudo gpasswd -a user1 sudo # add USER to GROUP |
- | $ fab -H $H auth.pro | + | $ fab -H $H -- sudo gpasswd -r user1 sudo # remove USER from GROUP |
</ | </ | ||
Line 102: | Line 102: | ||
def check_group(group): | def check_group(group): | ||
""" | """ | ||
- | res = run(" | + | res = run(" |
if res.failed is True: | if res.failed is True: | ||
puts(red(" | puts(red(" |
My Sites
SNS
Copyright (c) 2025 FastHandle - IT Operations Examples All Rights Reserved.