작성
·
33
0
질문 답변을 제공하지만, 강의 비용에는 Q&A는 포함되어 있지 않습니다.
다만 실습이 안되거나, 잘못된 내용의 경우는 알려주시면 가능한 빠르게 조치하겠습니다!
[질문 전 답변]
1. 강의 내용과 관련된 질문인가요? [예 | 아니요]
2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? [예 | 아니요]
3. 질문 잘하기 법을 읽어보셨나요? [예 | 아니요]
(https://www.inflearn.com/blogs/1719)
4. 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
[질문 하기]
영상처럼 vm이 똑같이 안만들어집니다.
강의 본문에
Vagrantfile 수정
Vagrant.configure("2") do |config| config.vm.define:"ansible-server" do |cfg| cfg.vm.box = "centos/7" cfg.vm.provider "virtualbox" do |vb| vb.name = "Ansible-Server(Udemy-rat)" end cfg.vm.host_name = "ansible-server" cfg.vm.synced_folder ".", "/Vagrant", disable: true cfg.vm.network "public_network", ip: "192.168.0.10" cfg.vm.network "forwarded_port", guest: 22, host: 19210, auto_correct: false, id: "ssh" cfg.vm.provision "shell", path: "bootstrarp.sh" end end
bootstrap.sh 수정
#! /usr/bin/env bash yum install epel-release -y yum install ansible -y
하고 vagrant up을 하면 호스트네임 설정이 안되서 ansible-server로 접속이 안되고 네트워크 인터페이스는 eth0,1이 생기는데 0은 nat인터페이스, 1은 브릿지인터페이스로 잡힙니다. 브릿지 인터페이스 잡힌것도 설정파일에 정의한 네트워크로 안잡히고요.
답변 2
0
안녕하세요
어떤 메시지와 함께 안 만들어지는지 알 수 있을까요?
우선 호스트 이름이 설정이 안된다는 것은 베이그런트가 적용이 안되었다는 수준이라서요.
CentOS 7은 정상적으로 올라왔나요?
호스트 이름이 어떤걸로 보이나요?
메시지를 전체를 제공해 주실 수 있을까요? 보고 말씀드려야 할 것 같아요.
안녕하세요
해당 내용을 공유해 주셔서 감사드립니다.
centOS v7의 repo가 보관 형태로 옮겨져서 이걸 변경해 주는 구문을 추가하였습니다.
git pull 후에 다시 시도 부탁드려도 될까요?
안되는 부분이 또 있다면 편하게 말씀 부탁드립니다.
0
안녕하세요, 인프런 AI 인턴입니다.
김태웅님, Vagrantfile에서 설정된 내용이 정확히 반영되지 않는 문제로 고민이 있으신 것 같습니다. Ansible 서버의 Vagrantfile과 bootstrap.sh의 설정문제를 해결하기 위해 몇 가지 점검 사항을 안내 드리겠습니다.
Vagrantfile 구성 확인:
config.vm.network "public_network", ip: "192.168.0.10"
부분에서 IP 주소를 기기와 네트워크 환경에 맞게 확인해 주세요. 만약 충돌이 발생하거나 브리지 네트워크가 다른 네트워크를 선택했다면 IP 주소 수정을 고려해 보세요.cfg.vm.box
를 정의하는 부분이 정확했는지 확인해 주세요. config.vm.define
와 cfg.vm.box
같은 부분에서 오타 실수가 없는지 점검하세요.VirtualBox 네트워크 설정:
Bootstrap.sh 실행 확인:
bootstrap.sh
파일이 제대로 실행되고 있는지 확인하세요. Ansible 설치가 제대로 완료되었는지 확인하기 위해 Ansible 버전 정보 명령어를 통해 설치 여부를 점검할 수 있습니다.공유 폴더 동기화:
synced_folder
설정이 disable: true
로 설정되어 있습니다. 파일 동기화를 원치 않는다면 이대로 유지하면 되나, 로컬 파일 동기화를 원하면 이 설정을 false로 변경해야 합니다.비슷한 질문을 참고하실 수 있는 게시물을 추천드립니다:
- Vagrantfile 이용하여 vm 구성시 질문드립니다.
위 링크에서 강의 예제와 관련된 설정 방법을 살펴보거나 유사한 문제 해결 과정을 확인하실 수 있습니다.
저는 질문자님의 이해를 돕고자 지식공유자님의 기존 답변을 참고하여 유사한 답변 링크를 추천해드리고 있습니다.
현재 베타 기능으로 답변이 만족스럽지 않을 수 있는 점 양해 부탁드립니다. 🙏
추가적으로 궁금한 점이 있으시면, 이어서 질문해 주세요. 곧 지식공유자께서 답변해 주실 것입니다.
안녕하세요
1.cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
2.vbox 입니다.
3.vagrant up
Bringing machine 'ansible-server' up with 'virtualbox' provider...
==> ansible-server: Importing base box 'centos/7'...
==> ansible-server: Matching MAC address for NAT networking...
==> ansible-server: Checking if box 'centos/7' version '2004.01' is up to date...
==> ansible-server: Setting the name of the VM: Ansible-Server(Udemy-rat)
==> ansible-server: Clearing any previously set network interfaces...
==> ansible-server: Specific bridge 'eth0' not found. You may be asked to specify
==> ansible-server: which network to bridge to.
==> ansible-server: Preparing network interfaces based on configuration...
ansible-server: Adapter 1: nat
ansible-server: Adapter 2: bridged
==> ansible-server: Forwarding ports...
ansible-server: 22 (guest) => 19210 (host) (adapter 1)
==> ansible-server: Booting VM...
==> ansible-server: Waiting for machine to boot. This may take a few minutes...
ansible-server: SSH address: 127.0.0.1:19210
ansible-server: SSH username: vagrant
ansible-server: SSH auth method: private key
ansible-server:
ansible-server: Vagrant insecure key detected. Vagrant will automatically replace
ansible-server: this with a newly generated keypair for better security.
ansible-server:
ansible-server: Inserting generated public key within guest...
ansible-server: Removing insecure key from the guest if it's present...
ansible-server: Key inserted! Disconnecting and reconnecting using new SSH key...
==> ansible-server: Machine booted and ready!
[ansible-server] No Virtualbox Guest Additions installation found.
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
미러 못찾는 메세지
Cannot find a valid baseurl for repo: base/7/x86_64
Skipping unmount of Virtualbox Guest Additions ISO, because it was not mounted.
==> ansible-server: Checking for guest additions in VM...
ansible-server: No guest additions were detected on the base box for this VM! Guest
ansible-server: additions are required for forwarded ports, shared folders, host only
ansible-server: networking, and more. If SSH fails on this machine, please install
ansible-server: the guest additions and repackage the box to continue.
ansible-server:
ansible-server: This is not an error message; everything may continue to work properly,
ansible-server: in which case you may ignore this message.
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
yum install -y centos-release
Stdout from the command:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Stderr from the command:
미러 못찾는 메세지 생략
Cannot find a valid baseurl for repo: base/7/x86_64