User Tools

Site Tools


environment_ansible

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

environment_ansible [2025/07/26 17:09] – - Imported by DokuWiki Advanced Plugin wikiadmenvironment_ansible [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-====== Cenário ====== 
-<file ruby Vagrantfile> 
-$ vim Vagrantfile 
-# -*- mode: ruby -*- 
-# vi: set ft=ruby : 
  
-ENV['VAGRANT_DEFAULT_PROVIDER'] = 'libvirt' 
- 
-vms = { 
-  'ansible-server' => {'memory' => '4096', 'cpus' => 2, 'ip' => '200', 'box' => 'g3anmart1ns/ubuntu22'}, 
-  'ub-vm-01' => {'memory' => '2048', 'cpus' => 2, 'ip' => '201', 'box' => 'g3anmart1ns/ubuntu22'}, 
-  'ol-vm-02' => {'memory' => '2048', 'cpus' => 2, 'ip' => '202', 'box' => 'g3anmart1ns/ol9'}, 
-  'de-vm-03' => {'memory' => '2048', 'cpus' => 2, 'ip' => '203', 'box' => 'g3anmart1ns/debian11'} 
-} 
- 
-Vagrant.configure('2') do |config| 
- 
-  config.vm.box_check_update = false 
- 
-  vms.each do |name, conf| 
-    config.vm.define "#{name}" do |k| 
-      k.vm.box = "#{conf['box']}" 
-      k.vm.hostname = "#{name}" 
-      k.vm.network 'private_network', ip: "10.240.0.#{conf['ip']}" 
-      k.vm.provider 'libvirt' do |lb| 
-        lb.memory = conf['memory'] 
-        lb.cpus = conf['cpus'] 
-      end 
-    end 
-  end 
-  config.vm.synced_folder ".", "/vagrant", disabled: true 
-end 
-</file> 
- 
-<file bash> 
-$ vagrant up 
-</file> 
- 
-<file bash> 
-$ vagrant status 
-Current machine states: 
- 
-ansible-server            running (libvirt) 
-ub-vm-01                  running (libvirt) 
-ol-vm-02                  running (libvirt) 
-de-vm-03                  running (libvirt) 
-</file> 
-===== Referências ===== 
-  - [[https://dev.to/project42/parallel-provisioning-with-vagrant-and-ansible-lgc|Parallel Provisioning with Vagrant and Ansible]] 
environment_ansible.1753560543.txt.gz · Last modified: by wikiadm