사용자 도구

사이트 도구


build_deploy_management:ansible

문서의 이전 판입니다!


Ansible

AWS

become

  • become: yes 일 경우 sudo 로 명령을 실행한다.
  • 이때, 비밀번호를 받는 다양한 방법이 존재할 수 있는데, 일단 ansible-playbook--ask-become-pass 옵션을 주면 최초 시작시 비밀번호를 물어본다.

Local 실행

- name: playbook name
  hosts: 127.0.0.1
  connection: local
  tasks:
    - name: blah.. blah..
# 실행
ansible-playbook playbook.yml

File 생성

  tasks:
  - name: Ansible create file with content example
    copy:
      dest: "/Users/mdtutorials2/Documents/Ansible/remote_server.txt"
      content: "contents"
      mode: 0777
      owner: mdtutorials2

환경변수 읽기

- debug: msg="{{ lookup('env', 'HOME') }} is an environment variable"

shell & command

참조

build_deploy_management/ansible.1599976834.txt.gz · 마지막으로 수정됨: 2020/09/13 15:00 저자 kwon37xi