Ansible-Puppet-Chef
[ansible] command 명령 내리기
'김용환'
2014. 9. 10. 16:42
ansible을 이용하여 단순하게 서버에 대해서 reboot, ping 명령어를 내릴 수 있다.
http://docs.ansible.com/modules.html
게다가 hosts의 모든 서버에 대해서 agt-get으로 apache를 설치했는지 service daemon으로 apache2 데몬이 running인지를 확인할 수 있다.
$ ansible all -i hosts --sudo --verbose --module-name=apt --args="name=apache2 state=present"
127.0.0.1 | success >> {
"changed": false
}
$ ansible all -i hosts --sudo --verbose --module-name=service --args="name=apache2 state=running"
127.0.0.1 | success >> {
"changed": false,
"name": "apache2",
"state": "started"
}