yeonghoon.kim

  • 게시판
  • 갤러리

infra-base 기본 서버 설정 메모

김영훈 2026.01.20 09:35 조회 수 : 171

# ansible/playbook-dev.yml

- name: 로컬 개발환경 설정
  hosts: all
  become: true
  vars_files:
    - vars/main.yml

  tasks:
    - name: Docker 패키지 설치
      ansible.builtin.apt:
        name:
          - docker-ce
          - docker-ce-cli
          - containerd.io
          - docker-buildx-plugin
          - docker-compose-plugin
        state: present

    - name: Docker 서비스 시작 및 활성화
      ansible.builtin.systemd:
        name: docker
        state: started
        enabled: true

    - name: 사용자를 docker 그룹에 추가
      ansible.builtin.user:
        name: "{{ dev_user }}"
        groups: docker
        append: true

    - name: Python 패키지 설치
      ansible.builtin.apt:
        name:
          - python3
          - python3-pip
          - python3-venv
        state: present

 

 

 

# ansible/playbook-prod.yml

- name: Oracle Linux 9 서버 초기 설정
  hosts: prod
  become: true
  vars_files:
    - vars/prod.yml

  tasks:
    - name: 타임존 설정 (Asia/Seoul)
      community.general.timezone:
        name: "{{ timezone }}"

    - name: SELinux 비활성화
      ansible.posix.selinux:
        state: disabled

    - name: 방화벽(firewalld) 중지 및 비활성화
      ansible.builtin.systemd:
        name: firewalld
        state: stopped
        enabled: false
      ignore_errors: true

    - name: Docker 패키지 설치
      ansible.builtin.dnf:
        name:
          - docker-ce
          - docker-ce-cli
          - containerd.io
          - docker-buildx-plugin
          - docker-compose-plugin
        state: present

 

 

# ansible/vars/prod.yml

timezone: "Asia/Seoul"
docker_user: "opc"

swap_file_path: "/swapfile"
swap_size_mb: 8192

base_packages:
  - git
  - curl
  - vim
  - net-tools

 

 

# ansible/ansible.cfg

[defaults]
host_key_checking = False
interpreter_python = auto_silent

[ssh_connection]
ssh_args = -o ControlMaster=auto -o ControlPersist=60s

 


  • 추천 0

  • 비추천 0
이 게시물을
목록

댓글 0

번호 제목 글쓴이 날짜 조회 수
공지 2025 일본 여행 계획 김영훈 2024.10.10 4119
공지 현금, 저축, 투자, 지출, 예산, 보험 내역(2024-05-30) 김영훈 2024.03.10 3752
297 DGX Spark LLM 벤치마크 김영훈 2026.02.11 132
296 GPU 모니터링 대시보드 구축 김영훈 2026.02.11 150
295 Docker Ollama 트러블슈팅 김영훈 2026.02.11 128
294 원격 LLM 챗봇 테스트 김영훈 2026.02.11 140
293 DGX Ollama 구축 김영훈 2026.02.11 183
292 OpenClaw cron regression 대응 김영훈 2026.02.08 186
291 WAF honeypot 설정 김영훈 2026.02.07 104
290 smtp-relay 설정 김영훈 2026.02.06 195
289 openclaw 구축 작업 노트 [2] 김영훈 2026.02.01 341
288 Traefik 설정 김영훈 2026.01.28 353
287 GitLab CI/CD 테스트 김영훈 2026.01.28 216
286 OpenVPN 구축 김영훈 2026.01.28 143
285 ollama-chatbot 테스트 메모 김영훈 2026.01.27 355
284 monitoring 설정 김영훈 2026.01.23 130
283 임시 파킹 페이지 김영훈 2026.01.20 308
» infra-base 기본 서버 설정 메모 김영훈 2026.01.20 171
281 [바이브코딩 - 클로드] kospiAlarm 작업 메모 김영훈 2025.10.29 109
280 [바이브코딩 - 클로드] fullstack_template 작업 메모 김영훈 2025.10.18 243
279 [바이브코딩 - 클로드] reminder_android 작업 메모 김영훈 2025.10.17 85
278 [바이브코딩 - 클로드] bingbingsubway 작업 메모 김영훈 2025.10.12 165
쓰기 태그
 첫 페이지 1 2 3 4 5 6 7 8 9 10 끝 페이지