빠른 참조

Ansible 플레이북 실무 예제 치트시트

Ruby, PostgreSQL, GitLab 및 웹 서버 설치를 위한 실무 Ansible 플레이북 예제 및 구성 템플릿 모음.

· 게시일

서버 프로비저닝 및 애플리케이션 배포에 바로 활용할 수 있는 실제 Ansible 플레이북 저장소와 태스크 예제 모음.

🔗 Related: Ansible 기본 치트시트 · Ansible 모듈 치트시트 · Ansible 퀵스타트 가이드

오픈소스 플레이북 구현 사례


자주 사용되는 다중 작업 스니펫

Nginx 및 Let's Encrypt SSL 전체 설정

- name: Configure Web Server with Nginx
  hosts: webservers
  become: true
  tasks:
    - name: Ensure Nginx is installed
      apt:
        name: nginx
        state: present
        update_cache: yes

    - name: Copy site configuration template
      template:
        src: templates/nginx.conf.j2
        dest: /etc/nginx/sites-available/default
      notify: Reload Nginx

    - name: Ensure Nginx service is running and enabled
      service:
        name: nginx
        state: started
        enabled: yes

  handlers:
    - name: Reload Nginx
      service:
        name: nginx
        state: reloaded

관련 주제