Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
flame-clmc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
flame
flame-clmc
Commits
9db5b725
Commit
9db5b725
authored
7 years ago
by
MJB
Browse files
Options
Downloads
Patches
Plain Diff
#38 fixed bugs in vagrantfile
parent
75326d04
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Vagrantfile
+31
-25
31 additions, 25 deletions
Vagrantfile
with
31 additions
and
25 deletions
Vagrantfile
+
31
−
25
View file @
9db5b725
...
...
@@ -26,7 +26,6 @@
require
'getoptlong'
require
'yaml'
# Custom options:
# --infra <infradir>
...
...
@@ -53,47 +52,54 @@ puts "custom config file: /infra/#{infra}/rspec.yml"
host_rspec_file
=
"infra/
#{
infra
}
/rspec.yml"
hosts
=
YAML
.
load_file
(
host_rspec_file
)
# Start creating VMS using xenial64 as the base box
Vagrant
.
configure
(
"2"
)
do
|
config
|
config
.
vm
.
box
=
"ubuntu/xenial64"
# Dynamic VMs
hosts
[
'hosts'
].
each
do
|
host
|
#p host["name"]
instance_name
=
host
[
"name"
]
config
.
vm
.
define
instance_name
do
|
instance_config
|
# Specify VM properties
# Specify VM properties
instance_config
.
vm
.
hostname
=
instance_name
instance_config
.
disksize
.
size
=
host
[
"disk"
]
instance_config
.
vm
.
provider
"virtualbox"
do
|
v
|
v
.
customize
[
"modifyvm"
,
:id
,
"--memory"
,
host
[
"memory"
]]
v
.
customize
[
"modifyvm"
,
:id
,
"--cpus"
,
host
[
"cpus"
]]
end
# Configure network
# Configure network, not that we only expect 1 test to be running so we have one internal network
config
.
vm
.
network
:private_network
,
ip:
"
#{
host
[
"ip_address"
]
}
"
,
virtualbox__intnet:
"clmc-net"
# Port forwarding
puts
"Forwarding the following specified ports for
#{
host
[
"name"
]
}
:"
host
[
'forward_ports'
].
each
do
|
port
|
puts
"Forwarding guest:
#{
port
[
"guest"
]
}
=> host:
#{
port
[
"host"
]
}
"
config
.
vm
.
network
"forwarded_port"
,
guest:
port
[
"guest"
],
host:
port
[
"host"
]
end
# Switch case added here to make clmc-service provisioning simple without having to have a complex rspec.yml file
# We only run a service installation script and the agent installation script when creating a specific service VM, not the clmc-service VM
case
host
when
'clmc-service'
config
.
vm
.
provision
:shell
,
:path
=>
"scripts/clmc-service/
#{
host
[
"install_script"
]
}
"
config
.
vm
.
provision
:shell
,
:path
=>
"scripts/clmc-service/
#{
host
[
"start_script"
]
}
"
when
(
not
'clmc-service'
)
# specific service install
service_install_path
=
"test/services/
#{
host
[
"service_name"
]
}
/install-
#{
host
[
"service_name"
]
}
.sh"
puts
"installing service script:
#{
service_install_path
}
"
config
.
vm
.
provision
:shell
,
:path
=>
service_install_path
# agent install
config
.
vm
.
provision
:shell
,
:path
=>
"scripts/clmc-agent/install-clmc-agent.sh"
,
:args
=>
"/vagrant/test/services/
#{
host
[
"service_name"
]
}
/telegraf_
#{
host
[
"service_name"
]
}
_template.conf
#{
host
[
"location"
]
}
#{
host
[
"sfc_id"
]
}
#{
host
[
"sfc_id_instance"
]
}
#{
host
[
"sf_id"
]
}
#{
host
[
"sf_id_instance"
]
}
#{
host
[
"ipendpoint_id"
]
}
#{
host
[
"influxdb_url"
]
}
#{
host
[
"database_name"
]
}
"
# Port forwarding
puts
"Forwarding the following specified ports for
#{
host
[
"name"
]
}
:"
host
[
'forward_ports'
].
each
do
|
port
|
puts
"Forwarding guest:
#{
port
[
"guest"
]
}
=> host:
#{
port
[
"host"
]
}
"
config
.
vm
.
network
"forwarded_port"
,
guest:
port
[
"guest"
],
host:
port
[
"host"
]
end
end
# Switch case added here to make clmc-service provisioning simple without having to have a complex rspec.yml file
# We only run a service installation script and the agent installation script when creating a specific service VM, not the clmc-service VM
puts
"Instance name
#{
instance_name
}
:"
case
instance_name
when
'clmc-service'
config
.
vm
.
provision
:shell
,
:path
=>
"scripts/clmc-service/
#{
host
[
"install_script"
]
}
"
config
.
vm
.
provision
:shell
,
:path
=>
"scripts/clmc-service/
#{
host
[
"start_script"
]
}
"
else
puts
"Provisioning
#{
instance_name
}
:"
# specific service install
service_install_path
=
"test/services/
#{
host
[
"service_name"
]
}
/install-
#{
host
[
"service_name"
]
}
.sh"
puts
"installing service script:
#{
service_install_path
}
"
config
.
vm
.
provision
:shell
,
:path
=>
service_install_path
# agent install
config
.
vm
.
provision
:shell
,
:path
=>
"scripts/clmc-agent/install-clmc-agent.sh"
,
:args
=>
"/vagrant/test/services/
#{
host
[
"service_name"
]
}
/telegraf_
#{
host
[
"service_name"
]
}
_template.conf
#{
host
[
"location"
]
}
#{
host
[
"sfc_id"
]
}
#{
host
[
"sfc_id_instance"
]
}
#{
host
[
"sf_id"
]
}
#{
host
[
"sf_id_instance"
]
}
#{
host
[
"ipendpoint_id"
]
}
#{
host
[
"influxdb_url"
]
}
#{
host
[
"database_name"
]
}
"
end
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment