Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vagrantsetup
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
devbox
vagrantsetup
Commits
9f332a2c
Commit
9f332a2c
authored
Aug 02, 2019
by
Reimar Stier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hello ansible
parent
25d09e02
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
7 deletions
+24
-7
Vagrantfile
Vagrantfile
+19
-7
playbook.yml
playbook.yml
+5
-0
No files found.
Vagrantfile
View file @
9f332a2c
...
...
@@ -3,15 +3,17 @@
DISKS
=
[
{
"name"
=>
"home"
,
"size"
=>
5
,
"size"
=>
5
0
,
"port"
=>
1
},
{
"name"
=>
"opt"
,
"size"
=>
5
,
"size"
=>
1
5
,
"port"
=>
2
},
{
"name"
=>
"docker"
,
"size"
=>
40
,
"port"
=>
3
},
]
HTTP_PROXY
=
"http://192.168.200.1:3128"
BOX_NAME
=
"devbox"
Vagrant
.
configure
(
"2"
)
do
|
config
|
...
...
@@ -20,12 +22,10 @@ Vagrant.configure("2") do |config|
config
.
vm
.
network
"private_network"
,
ip:
"192.168.200.4"
,
adapter:
2
config
.
vm
.
hostname
=
"devbox.devops.detss.corpintra.net"
# require
additional vagrant plugins
# require
s additional vagrant plugin
config
.
disksize
.
size
=
"20GB"
config
.
proxy
.
http
=
HTTP_PROXY
config
.
proxy
.
https
=
HTTP_PROXY
config
.
proxy
.
no_proxy
=
"localhost,127.0.0.1"
# configure VM settings and additional disks
config
.
vm
.
provider
"virtualbox"
do
|
vb
|
vb
.
memory
=
"4096"
vb
.
cpus
=
4
...
...
@@ -42,6 +42,7 @@ Vagrant.configure("2") do |config|
end
end
# add ssh key
config
.
vm
.
provision
"shell"
do
|
s
|
ssh_pub_key
=
File
.
readlines
(
"
#{
Dir
.
home
}
/.ssh/id_rsa.pub"
).
first
.
strip
s
.
inline
=
<<-
SHELL
...
...
@@ -50,4 +51,15 @@ Vagrant.configure("2") do |config|
echo
#{
ssh_pub_key
}
>> /root/.ssh/authorized_keys
SHELL
end
# Set the name of the VM. See: http://stackoverflow.com/a/17864388/100134
config
.
vm
.
define
BOX_NAME
do
|
box
|
end
# Run Ansible from the Vagrant VM
config
.
vm
.
provision
"ansible_local"
do
|
ansible
|
# ansible.compatibility_mode = "2.0"
ansible
.
playbook
=
"playbook.yml"
ansible
.
become
=
true
end
end
playbook.yml
0 → 100644
View file @
9f332a2c
---
-
name
:
playbook
hosts
:
devbox
tasks
:
-
debug
:
msg="hello world"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment