Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate Configuration Management 실습 환경 구성을 위한 Vagrantfile #29

Open
ur2e opened this issue Oct 6, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@ur2e
Copy link
Collaborator

ur2e commented Oct 6, 2023

Automate Configuration Management

  • 변경 사항

    • 가상머신 이미지 : 우분투 버전 변경, 레포지토리에 명시된 버전은 apt update 시 문제가 발생하여 22.04 버전으로 설정
    • 호스트전용네트워크 추가 : 가상머신 간 통신을 위해 추가
  • 사용자 정보

    • user : vagrant
    • password: vargrant
Vagrant.configure("2") do |config|
    servers=[
      {
        :hostname => "db01",
        :box => "bento/ubuntu-22.04",
        :ip => "192.168.56.130",
        :ssh_port => '2210'
      },
      {
        :hostname => "web01",
        :box => "bento/ubuntu-22.04",
        :ip => "192.168.56.131",
        :ssh_port => '2211'
      },
      {
        :hostname => "web02",
        :box => "bento/ubuntu-22.04",
        :ip => "192.168.56.132",
        :ssh_port => '2212'
      },
      {
        :hostname => "loadbalancer",
        :box => "bento/ubuntu-22.04",
        :ip => "192.168.56.134",
        :ssh_port => '2213'
      }
  
    ]
  
  config.vm.base_address = 600
  
    servers.each do |machine|
  
      config.vm.define machine[:hostname] do |node|
        node.vm.box = machine[:box]
        node.vm.hostname = machine[:hostname]
  
        # node.vm.network :public_network, bridge: "Intel(R) Ethernet Connection (7) I219-V", ip: machine[:ip]
        node.vm.network "forwarded_port", guest: 22, host: machine[:ssh_port], id: "ssh"
        node.vm.network "private_network", ip: machine[:ip]
  
        node.vm.provider :virtualbox do |v|
          v.customize ["modifyvm", :id, "--memory", 2048]
          v.customize ["modifyvm", :id, "--name", machine[:hostname]]
        end
      end
    end
  
  end
@ur2e ur2e added the documentation Improvements or additions to documentation label Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant