앤서블_명령어 썸네일형 리스트형 [Ansible] lineinfile 모듈 Ansible lineinfile 모듈 lineinfile 모듈 - 호스트 파일 편집(/etc/ansible/hosts) $ ansible dbs -m lineinfile -b -K -a "dest=/etc/hosts line='10.31.3.72 galera01' state=present" BECOME password: db1 | CHANGED => { "backup": "", "changed": true, "msg": "line added" } db3 | CHANGED => { "backup": "", "changed": true, "msg": "line added" } db2 | CHANGED => { "backup": "", "changed": true, "msg": "line added" } $.. 더보기 [Ansible] shell, command, yum, user 모듈 Ansible shell, command, yum, user 모듈 Ansible에서 모듈 사용법 shell 모듈 $ ansible db1 -m shell -a "free -h" db1 | CHANGED | rc=0 >> total used free shared buff/cache available Mem: 3.8G 162M 2.7G 540K 997M 3.4G Swap: 0B 0B 0B command 모듈 $ ansible db1 -m command -a "cat /etc/passwd" db1 | CHANGED | rc=0 >> root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin ... ec2-user:x:1000:1000:EC2 Defaul.. 더보기 이전 1 다음