IaC 도구로 아래의 작업을 코드화 가능 아래의 작업 내용을 vagrantfile에 정의하고 공유한다.
- VM 생성
- OS 설정
- MW나 Application 배포 등
Windows 다운로드 링크: Downloads | Vagrant by HashiCorp (vagrantup.com)
Downloads | Vagrant by HashiCorp
Vagrant enables users to create and configure lightweight, reproducible, and portable development environments.
www.vagrantup.com
Vagrant 기본 명령어
- vagrant init: vagrant를 배포하기 위한 vagrantfile 생성
- vagrant halt: vagrant 머신 종료
- vagrant destroy: vagrant 머신 삭제
- vagrant ssh: vagrant 머신에 접속
- vagrant provision: 머신 설정을 변경하고 적용
Workspace를 생성한다.(여기선 temp)
1. vagrant init 명령 실행을 하면 vagrantfile이 생기는 것을 확인 가능하다.
2. 앞에서 말한대로 vagrantfile을 통해 설정을 정의한다.

3. VM 생성확인

4. 접속 vagrant ssh 로 접속한다.
nmcli con mod 를 통한 IP 수정
nmcli con up 을 통해 변경 확인
다시복구
가상머신 종료(vagrant up을 통해 다시 실행가능)
$ vagrant halt
==> centvm: Attempting graceful shutdown of VM...
가상머신 삭제
$ vagrant destroy
centvm: Are you sure you want to destroy the 'centvm' VM? [y/N] y
==> centvm: Destroying VM and associated drives...
'IaC' 카테고리의 다른 글
Encoding::CompatibilityError: incompatible character encodings: UTF-8 and CP-949 (0) | 2021.12.29 |
---|---|
[Vagrant] nginx 기동 (0) | 2021.12.04 |
Terraform Gitlab 연동 (0) | 2021.10.31 |
[Terraform] 개념 정리 (0) | 2021.07.05 |
[terraform] AWS Credentials 설정 (0) | 2021.03.28 |