글
YAML with AWX : FILE COPY Sample with debug
AWX
2019. 1. 2. 11:23
반응형
- Yaml을 이용하여 Node에 tar 파일을 전송하고 tar를 해제하는 작업
- 설명은 Using Debug: 와 Using Register: 문서를 참조
- .
- AWX 적용
- 실행 결과
글
YAML with AWX : File Copy from Host to Host : Local Copy
AWX
2019. 1. 2. 11:21
반응형
- HOST 서버에 있는 파일을 Copy 해야 하는 경우
- hosts파일에 다음 추가
- [local]
- 127.0.0.1
- 소스파일
- 실행 결과
- 참고
- 복사 대상이 큰 경우 시간이 매우 오래 걸림
- tar 후 복사 후 extract 추천
글
YAML with AWX : Debug for ansible_facts
카테고리 없음
2019. 1. 2. 11:19
반응형
- Yaml에서 ansible_facts를 사용하기 위해 어떤 것들이 지원되는지 알아보기 위한 샘플 코드
- #debugtest.yml 파일 생성
---
- name: debug Test
hosts: all
tasks:
- name: debug testing
shell: echo "debug test"
- debug: var=ansible_facts- 들여쓰기 등 주의
- 아래 이미지와 같이 생성 후 저장
- #ansible-playbook -i hosts.inv debugtest.yml
- 중간 생략
- -
- Yaml에서 ['os_family']를 확인할 경우
tasks: - shell: echo "only on Red Hat 6, derivatives, and later" when: ansible_facts['os_family'] == "RedHat" and ansible_facts['lsb']['major_release']|int >= 6
의 형태로 사용 가능
- 자세한 내용을 알고 싶을 경우 stdout을 파일로 받아서 확인
- #ansible-playbook -i hosts.inv debugtest.yml > out.txt
- #cat out.txt
- -
- 목표
- ansible_fact에서 사용가능한 종류 확인