Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
Terraform Openstack
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Bo-Chun Chen
Terraform Openstack
Commits
c9549e26
Commit
c9549e26
authored
5 years ago
by
Ryan Randles Jones
Browse files
Options
Downloads
Patches
Plain Diff
Update Vagrantfile
parent
362fc499
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Vagrantfile
+59
-17
59 additions, 17 deletions
Vagrantfile
with
59 additions
and
17 deletions
Vagrantfile
+
59
−
17
View file @
c9549e26
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant
.
configure
(
"2"
)
do
|
config
|
config
.
ssh
.
insert_key
=
false
config
.
vbguest
.
auto_update
=
true
# create Google Cloud Platform Management (mgmt) node
config
.
vm
.
define
:terraform_mgmt
do
|
terraform_mgmt_config
|
terraform_mgmt_config
.
vm
.
box
=
"ubuntu/bionic64"
terraform_mgmt_config
.
vm
.
hostname
=
"terraform-mgmt"
terraform_mgmt_config
.
vm
.
network
:private_network
,
ip:
"192.168.56.10"
terraform_mgmt_config
.
vm
.
synced_folder
"."
,
"/home/vagrant/devops101"
,
mount_options:
[
"dmode=775"
]
terraform_mgmt_config
.
vm
.
provider
"virtualbox"
do
|
vb
|
vb
.
name
=
"terraform-mgmt"
opts
=
[
"modifyvm"
,
:id
,
"--natdnshostresolver1"
,
"on"
]
vb
.
customize
opts
vb
.
memory
=
"1024"
end
terraform_mgmt_config
.
vm
.
provision
:shell
,
path:
"bootstrap-mgmt.sh"
end
config
.
ssh
.
username
=
'centos'
config
.
vm
.
allowed_synced_folder_types
=
[
:rsync
]
#config.ssh.private_key_path = "~/.ssh/id_rsa.pub"
#config.vm.synced_folder '.', '/vagrant', disabled: true, type: 'rsync'
config
.
vm
.
define
"ohpc"
do
|
ohpc
|
ohpc
.
ssh
.
host
=
'164.111.161.145'
ohpc
.
vm
.
hostname
=
"ohpc"
ohpc
.
vm
.
provider
:openstack
do
|
ohpc
|
ohpc
.
server_name
=
'ohpc'
ohpc
.
floating_ip
=
"192.168.16.145"
ohpc
.
image
=
'CentOS-7-x86_64-GenericCloud-1905'
end
end
config
.
vm
.
define
"ood"
do
|
ood
|
ood
.
vm
.
box
=
"centos/7"
# version placeholder for selecting specific vagrant boxes
# used mainly for debugging and sanity checking
# leave commented to use the latest version in the local cache
#ood.vm.box_version = "1804.02"
ood
.
vm
.
hostname
=
"ood"
ood
.
vm
.
network
"private_network"
,
ip:
"10.1.1.254"
,
virtualbox__intnet:
"compute"
ood
.
vm
.
network
"forwarded_port"
,
guest:
80
,
host:
8080
,
auto_correct:
true
ood
.
vm
.
network
"forwarded_port"
,
guest:
443
,
host:
8443
,
auto_correct:
true
end
# define user's key and insecure default
# insecure default is required for initial provisioning
#config.ssh.private_key_path = ["~/.ssh/id_rsa", "~/.vagrant.d/insecure_private_key"]
# append user's key to vagrant config to avoid overwrite of existing authorized_keys
# https://stackoverflow.com/a/31153912/8928529
#config.vm.provision "ssh_pub_key", type: "shell" do |s|
# ssh_pub_key = File.readlines("#{Dir.home}/.ssh/id_rsa.pub").first.strip
# s.inline = <<-SHELL
# echo #{ssh_pub_key} >> /home/centos/.ssh/authorized_keys
# SHELL
#end
config
.
vm
.
provision
"shell"
,
inline:
<<-
SHELL
if [ -f /vagrant/localenv.sh ]; then
. /vagrant/localenv.sh
fi
hostnamectl set-hostname ohpc
yum install -y epel-release
yum install -y ansible git vim bash-completion
yum install -y NetworkManager
systemctl restart NetworkManager
nmcli con mod "Wired connection 1" connection.id "eth1"
ansible-playbook -c local -i /vagrant/CRI_XCBC/hosts -l `hostname` /vagrant/CRI_XCBC/site.yaml -b
SHELL
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