반응형
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 dbs -m lineinfile -b -K -a "dest=/etc/hosts line='10.31.3.72 galera01\n10.31.4.78 galera02\n10.31.3.63 galera03' state=present"
BECOME password:
db3 | CHANGED => {
"backup": "",
"changed": true,
"msg": "line added"
}
db2 | CHANGED => {
"backup": "",
"changed": true,
"msg": "line added"
}
db1 | CHANGED => {
"backup": "",
"changed": true,
"msg": "line added"
}
728x90
반응형
'퍼블릭 클라우드' 카테고리의 다른 글
Amazon Elastic File System(EFS)을 구성하는 방법 (0) | 2021.07.23 |
---|---|
[RDS] DB import(복구) 시 에러 (0) | 2021.06.07 |
[Ansible] shell, command, yum, user 모듈 (0) | 2021.05.27 |
[Ansible] Amazon Linux에 Ansible 설치하기 (0) | 2021.05.27 |
[aws] EC2 이미지 빌더(EC2 Image Builder) (0) | 2021.05.20 |