Recent Comments
변군이글루
[Fabric] fabric hello print on CentOS 7 본문
fabric hello print on CentOS 7
컨테이너 실행
$ docker run -d --rm --network host --privileged --name fabric --hostname fabric centos "/sbin/init"
컨테이너 안으로 진입
$ docker exec -it fabric bash
python3, pip3, fabric3 설치
[root@fabric /]$ yum install -y python3-devel python3-pip vim net-tools git
[root@fabric /]$ pip3 install fabric3
python3 및 fab 버전 확인
[root@fabric ~]$ python3 --version
Python 3.6.8
[root@fabric ~]$ fab -V
Fabric3 1.14.post1
Paramiko 2.7.2
fabfile.py 편집
[root@fabric fctl]$ vim fabfile.py
def hello():
print("Hello world!")
def hello2(name="world"):
print("Hello %s!" % name)
fab 실행
[root@fabric fctl]$ fab --list
Available commands:
hello
hello2
[root@fabric fctl]$ fab hello
Hello world!
Done.
[root@fabric fctl]$ fab hello2:name=sangchul
Hello sangchul!
Done.
'* 리눅스' 카테고리의 다른 글
[명령어] dstat 명령어 (0) | 2021.01.21 |
---|---|
[linux] SSH Config 설정으로 SSH 간편하게 접속하기 (0) | 2021.01.19 |
[Fabric] fabric hello print on CentOS 7 (0) | 2021.01.11 |
[Fabric] fabric hello print on CentOS 8 (0) | 2021.01.11 |
[Shell Script] 반복문 for 문법 (0) | 2021.01.07 |
[Apache] Apache 로그 logrotate(로테이드) 설정 (0) | 2021.01.07 |
- Tag
- FAB, fabfile.py, fabric3
0 Comments