Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
titleConfig File설정 정보 확인

[devops@work-vm devops-lab]$ ansible --version

Code Block
titleconfig file
linenumberstrue
ansible 2.9.1
  config file = /home/devops/devops-lab/ansible.cfg
  configured module search path = [u'/home/devops/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
  • inventory파일 설정 확인
    • [devops@work-vm devops-lab]$ ansible web --list-hosts
Code Block
  hosts (3):
    web01-vm
    web02-vm
    web03-vm


Ansible 설정 테스트

Info
titleping 호출해보기

[devops@work-vm devops-lab]$ ansible web -m ping

Code Block
titleping 호출 처리결과
linenumberstrue
web01-vm | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
}
web03-vm | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
}
web02-vm | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
}


...