mirror of
https://codeberg.org/scottslowe/learning-tools.git
synced 2026-03-11 09:04:37 +00:00
Shift to nested YAML data files
Edit YAML data files to use nested data structures. Edit Vagrantfile to reference YAML data accordingly. Signed-off-by: Scott S. Lowe <scott.lowe@scottlowe.org>
This commit is contained in:
parent
d6abc231cd
commit
ba4d123faf
12 changed files with 74 additions and 64 deletions
10
consul-ansible/Vagrantfile
vendored
10
consul-ansible/Vagrantfile
vendored
|
|
@ -1,7 +1,7 @@
|
|||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
# Specify Vagrant version, Vagrant API version, and desired clone location
|
||||
# Specify minimum Vagrant version and Vagrant API version
|
||||
Vagrant.require_version '>= 1.6.0'
|
||||
VAGRANTFILE_API_VERSION = '2'
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||
# Don't check for box updates
|
||||
srv.vm.box_check_update = false
|
||||
srv.vm.hostname = machine['name']
|
||||
srv.vm.box = machine['vmw_box']
|
||||
srv.vm.box = machine['box']['vmw']
|
||||
|
||||
# Configure default synced folder (disable by default)
|
||||
if machine['sync_disabled'] != nil
|
||||
|
|
@ -53,14 +53,14 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||
if machine['nested'] == true
|
||||
vmw.vmx['vhv.enable'] = 'TRUE'
|
||||
end #if machine['nested']
|
||||
end # srv.vm.provider vmware_fusion
|
||||
end # srv.vm.provider 'vmware_fusion'
|
||||
|
||||
# Configure CPU & RAM per settings in machines.yml (VirtualBox)
|
||||
srv.vm.provider 'virtualbox' do |vb, override|
|
||||
vb.memory = machine['ram']
|
||||
vb.cpus = machine['vcpu']
|
||||
override.vm.box = machine['vb_box']
|
||||
end # srv.vm.provider virtualbox
|
||||
override.vm.box = machine['box']['vb']
|
||||
end # srv.vm.provider 'virtualbox'
|
||||
end # config.vm.define
|
||||
end # machines.each
|
||||
end # Vagrant.configure
|
||||
|
|
|
|||
|
|
@ -1,19 +1,22 @@
|
|||
---
|
||||
- name: "consul-01"
|
||||
vmw_box: "slowe/ubuntu-trusty-x64"
|
||||
vb_box: "ubuntu/trusty64"
|
||||
box:
|
||||
vmw: "slowe/ubuntu-trusty-x64"
|
||||
vb: "ubuntu/trusty64"
|
||||
ram: "512"
|
||||
vcpu: "1"
|
||||
ip_addr: 192.168.100.101
|
||||
ip_addr: "192.168.100.101"
|
||||
- name: "consul-02"
|
||||
vmw_box: "slowe/ubuntu-trusty-x64"
|
||||
vb_box: "ubuntu/trusty64"
|
||||
box:
|
||||
vmw: "slowe/ubuntu-trusty-x64"
|
||||
vb: "ubuntu/trusty64"
|
||||
ram: "512"
|
||||
vcpu: "1"
|
||||
ip_addr: 192.168.100.102
|
||||
ip_addr: "192.168.100.102"
|
||||
- name: "consul-03"
|
||||
vmw_box: "slowe/ubuntu-trusty-x64"
|
||||
vb_box: "ubuntu/trusty64"
|
||||
box:
|
||||
vmw: "slowe/ubuntu-trusty-x64"
|
||||
vb: "ubuntu/trusty64"
|
||||
ram: "512"
|
||||
vcpu: "1"
|
||||
ip_addr: 192.168.100.103
|
||||
ip_addr: "192.168.100.103"
|
||||
|
|
|
|||
10
consul/Vagrantfile
vendored
10
consul/Vagrantfile
vendored
|
|
@ -1,7 +1,7 @@
|
|||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
# Specify Vagrant version, Vagrant API version, and Vagrant clone location
|
||||
# Specify minimum Vagrant version and Vagrant API version
|
||||
Vagrant.require_version '>= 1.6.0'
|
||||
VAGRANTFILE_API_VERSION = '2'
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||
|
||||
# Specify hostname and Vagrant box
|
||||
srv.vm.hostname = machine['name']
|
||||
srv.vm.box = machine['vmw_box']
|
||||
srv.vm.box = machine['box']['vmw']
|
||||
|
||||
# Assign an additional static private network
|
||||
srv.vm.network 'private_network', ip: machine['priv_ip']
|
||||
|
|
@ -46,14 +46,14 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||
srv.vm.provider 'vmware_fusion' do |vmw|
|
||||
vmw.vmx['memsize'] = machine['ram']
|
||||
vmw.vmx['numvcpus'] = machine['vcpu']
|
||||
end # srv.vm.provider vmware_fusion
|
||||
end # srv.vm.provider 'vmware_fusion'
|
||||
|
||||
# Configure VMs with RAM and CPUs per settings in machines.yml (VirtualBox)
|
||||
srv.vm.provider 'virtualbox' do |vb, override|
|
||||
vb.memory = machine['ram']
|
||||
vb.cpus = machine['vcpu']
|
||||
override.vm.box = machine['vb_box']
|
||||
end # srv.vm.provider virtualbox
|
||||
override.vm.box = machine['box']['vb']
|
||||
end # srv.vm.provider 'virtualbox'
|
||||
end # config.vm.define
|
||||
end # machines.each
|
||||
end # Vagrant.configure
|
||||
|
|
|
|||
|
|
@ -1,19 +1,22 @@
|
|||
---
|
||||
- name: "consul-01"
|
||||
vmw_box: "slowe/ubuntu-trusty-x64"
|
||||
vb_box: "ubuntu/trusty64"
|
||||
box:
|
||||
vmw: "slowe/ubuntu-trusty-x64"
|
||||
vb: "ubuntu/trusty64"
|
||||
ram: "512"
|
||||
vcpu: "1"
|
||||
priv_ip: 192.168.100.101
|
||||
priv_ip: "192.168.100.101"
|
||||
- name: "consul-02"
|
||||
vmw_box: "slowe/ubuntu-trusty-x64"
|
||||
vb_box: "ubuntu/trusty64"
|
||||
box:
|
||||
vmw: "slowe/ubuntu-trusty-x64"
|
||||
vb: "ubuntu/trusty64"
|
||||
ram: "512"
|
||||
vcpu: "1"
|
||||
priv_ip: 192.168.100.102
|
||||
priv_ip: "192.168.100.102"
|
||||
- name: "consul-03"
|
||||
vmw_box: "slowe/ubuntu-trusty-x64"
|
||||
vb_box: "ubuntu/trusty64"
|
||||
box:
|
||||
vmw: "slowe/ubuntu-trusty-x64"
|
||||
vb: "ubuntu/trusty64"
|
||||
ram: "512"
|
||||
vcpu: "1"
|
||||
priv_ip: 192.168.100.103
|
||||
priv_ip: "192.168.100.103"
|
||||
|
|
|
|||
4
debian-generic/Vagrantfile
vendored
4
debian-generic/Vagrantfile
vendored
|
|
@ -31,7 +31,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||
srv.vm.hostname = machine['name']
|
||||
|
||||
# Specify the Vagrant box to use (use VMware box by default)
|
||||
srv.vm.box = machine['vmw_box']
|
||||
srv.vm.box = machine['box']['vmw']
|
||||
|
||||
# Configure default synced folder (disable by default)
|
||||
if machine['sync_disabled'] != nil
|
||||
|
|
@ -58,7 +58,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||
srv.vm.provider 'virtualbox' do |vb, override|
|
||||
vb.memory = machine['ram']
|
||||
vb.cpus = machine['vcpu']
|
||||
override.vm.box = machine['vb_box']
|
||||
override.vm.box = machine['box']['vb']
|
||||
end # srv.vm.provider 'virtualbox'
|
||||
end # config.vm.define
|
||||
end # machines.each
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
- name: jessie
|
||||
vmw_box: slowe/debian-81-x64
|
||||
vb_box: debian/jessie64
|
||||
ram: 1024
|
||||
vcpu: 1
|
||||
- name: "jessie"
|
||||
box:
|
||||
vmw: "slowe/debian-81-x64"
|
||||
vb: "debian/jessie64"
|
||||
ram: "1024"
|
||||
vcpu: "1"
|
||||
|
|
|
|||
10
lxc/Vagrantfile
vendored
10
lxc/Vagrantfile
vendored
|
|
@ -1,7 +1,7 @@
|
|||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
# Specify Vagrant version, Vagrant API version, and desired clone location
|
||||
# Specify minimum Vagrant version and Vagrant API version
|
||||
Vagrant.require_version '>= 1.6.0'
|
||||
VAGRANTFILE_API_VERSION = '2'
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||
# Don't check for box updates
|
||||
srv.vm.box_check_update = false
|
||||
srv.vm.hostname = machine['name']
|
||||
srv.vm.box = machine['vmw_box']
|
||||
srv.vm.box = machine['box']['vmw']
|
||||
|
||||
# Configure default synced folder (disable by default)
|
||||
if machine['sync_disabled'] != nil
|
||||
|
|
@ -45,14 +45,14 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||
if machine['nested'] == true
|
||||
vmw.vmx['vhv.enable'] = 'TRUE'
|
||||
end #if machine['nested']
|
||||
end # srv.vm.provider vmware_fusion
|
||||
end # srv.vm.provider 'vmware_fusion'
|
||||
|
||||
# Configure CPU & RAM per settings in machines.yml (VirtualBox)
|
||||
srv.vm.provider 'virtualbox' do |vb, override|
|
||||
vb.memory = machine['ram']
|
||||
vb.cpus = machine['vcpu']
|
||||
override.vm.box = machine['vb_box']
|
||||
end # srv.vm.provider virtualbox
|
||||
override.vm.box = machine['box']['vb']
|
||||
end # srv.vm.provider 'virtualbox'
|
||||
end # config.vm.define
|
||||
|
||||
# Provision the VM with Ansible
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
---
|
||||
- name: lxc-01
|
||||
vmw_box: slowe/ubuntu-trusty-x64
|
||||
vb_box: ubuntu/trusty64
|
||||
ram: 512
|
||||
vcpu: 1
|
||||
ip_addr: 192.168.100.100
|
||||
- name: "lxc-01"
|
||||
box:
|
||||
vmw: "slowe/ubuntu-trusty-x64"
|
||||
vb: "ubuntu/trusty64"
|
||||
ram: "512"
|
||||
vcpu: "1"
|
||||
ip_addr: "192.168.100.100"
|
||||
|
|
|
|||
10
lxd-ansible/Vagrantfile
vendored
10
lxd-ansible/Vagrantfile
vendored
|
|
@ -1,7 +1,7 @@
|
|||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
# Specify Vagrant version, Vagrant API version, and desired clone location
|
||||
# Specify minimum Vagrant version and Vagrant API version
|
||||
Vagrant.require_version '>= 1.6.0'
|
||||
VAGRANTFILE_API_VERSION = '2'
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||
# Don't check for box updates
|
||||
srv.vm.box_check_update = false
|
||||
srv.vm.hostname = machine['name']
|
||||
srv.vm.box = machine['vmw_box']
|
||||
srv.vm.box = machine['box']['vmw']
|
||||
|
||||
# Configure default synced folder (disable by default)
|
||||
if machine['sync_disabled'] != nil
|
||||
|
|
@ -45,14 +45,14 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||
if machine['nested'] == true
|
||||
vmw.vmx['vhv.enable'] = 'TRUE'
|
||||
end #if machine['nested']
|
||||
end # srv.vm.provider vmware_fusion
|
||||
end # srv.vm.provider 'vmware_fusion'
|
||||
|
||||
# Configure CPU & RAM per settings in machines.yml (VirtualBox)
|
||||
srv.vm.provider 'virtualbox' do |vb, override|
|
||||
vb.memory = machine['ram']
|
||||
vb.cpus = machine['vcpu']
|
||||
override.vm.box = machine['vb_box']
|
||||
end # srv.vm.provider virtualbox
|
||||
override.vm.box = machine['box']['vb']
|
||||
end # srv.vm.provider 'virtualbox'
|
||||
end # config.vm.define
|
||||
|
||||
# Provision the VM with Ansible
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
---
|
||||
- name: lxd-01
|
||||
vmw_box: slowe/ubuntu-trusty-x64
|
||||
vb_box: ubuntu/trusty64
|
||||
ram: 512
|
||||
vcpu: 1
|
||||
ip_addr: 192.168.100.100
|
||||
- name: "lxd-01"
|
||||
box:
|
||||
vmw: "slowe/ubuntu-trusty-x64"
|
||||
vb: "ubuntu/trusty64"
|
||||
ram: "512"
|
||||
vcpu: "1"
|
||||
ip_addr: "192.168.100.100"
|
||||
|
|
|
|||
4
ubuntu-generic/Vagrantfile
vendored
4
ubuntu-generic/Vagrantfile
vendored
|
|
@ -31,7 +31,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||
srv.vm.hostname = machine['name']
|
||||
|
||||
# Specify the Vagrant box to use (use VMware box by default)
|
||||
srv.vm.box = machine['vmw_box']
|
||||
srv.vm.box = machine['box']['vmw']
|
||||
|
||||
# Configure default synced folder (disable by default)
|
||||
if machine['sync_disabled'] != nil
|
||||
|
|
@ -58,7 +58,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||
srv.vm.provider 'virtualbox' do |vb, override|
|
||||
vb.memory = machine['ram']
|
||||
vb.cpus = machine['vcpu']
|
||||
override.vm.box = machine['vb_box']
|
||||
override.vm.box = machine['box']['vb']
|
||||
end # srv.vm.provider 'virtualbox'
|
||||
end # config.vm.define
|
||||
end # machines.each
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
- name: trusty
|
||||
vmw_box: slowe/ubuntu-trusty-x64
|
||||
vb_box: ubuntu/trusty64
|
||||
ram: 1024
|
||||
vcpu: 1
|
||||
- name: "trusty"
|
||||
box:
|
||||
vmw: "slowe/ubuntu-trusty-x64"
|
||||
vb: "ubuntu/trusty64"
|
||||
ram: "1024"
|
||||
vcpu: "1"
|
||||
|
|
|
|||
Loading…
Reference in a new issue