ansible - 01

ansible 에서 특정 노드만 빼기

  • OR
    (group1:group2)
    
  • NOT
    !group2
    
  • wildcard
    web*.aaa.com
    
  • regex
    (~web[0-9]+)
    

    ~: 처음 시작

  • AND
    (grout1:&group2)
    
  • sample
    ansible-playbook --limit '!node01,!node02,!node03,!node04' kubernetes.yml 
    ansible-playbook --limit 'all:!bad_host' playbook.yml
    ansible-playbook --limit 'all:!group1,!node100' kubernetes.yml 
    ansible-playbook --limit 'hoost1:host2' yourPlaybook.yml
    ansible-playbook --limit 'webservers:&prod:!python3' yourPlaybook.yml
    

setup module

ansible node02 -m setup

gathering fact 결과를 다 보여준다.

ansible all -m setup --tree ./fact

전체 인벤토리를 대상으로 setup을 실행해서 디렉토리에 저장해준다.

teamsmiley's profile image

teamsmiley

2018-10-25 00:00

Read more posts by this author