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
75245c29
Commit
75245c29
authored
Sep 02, 2019
by
Reimar Stier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move disk partition definitions to extra file
parent
4cbe3fdc
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
16 deletions
+42
-16
Readme.md
Readme.md
+6
-1
Vagrantfile
Vagrantfile
+3
-13
ansible.cfg
ansible.cfg
+1
-1
disks.yml
disks.yml
+22
-0
playbook.yml
playbook.yml
+3
-1
partitioning.yml
tasks/partitioning.yml
+7
-0
No files found.
Readme.md
View file @
75245c29
...
@@ -3,10 +3,15 @@ choco install vagrant
...
@@ -3,10 +3,15 @@ choco install vagrant
vagrant plugin install vagrant-disksize
vagrant plugin install vagrant-disksize
vagrant plugin install vagrant-proxyconf
vagrant plugin install vagrant-proxyconf
# Debug playbook in vagrant box
# Debug playbook
*
in vagrant box
```
vagrant ssh devbox
vagrant ssh devbox
cd /vagrant
cd /vagrant
ansible-playbook playbook.yml --connection=local -i devbox, -e ansible_become=true
ansible-playbook playbook.yml --connection=local -i devbox, -e ansible_become=true
```
*
From controlling host
`ANSIBLE_TAGS=partition vagrant provision`
# SSH configuration
# SSH configuration
Provision own ssh key to the vagrant box. Compare
[
documentation|https://www.vagrantup.com/docs/vagrantfile/ssh_settings.html
]
Provision own ssh key to the vagrant box. Compare
[
documentation|https://www.vagrantup.com/docs/vagrantfile/ssh_settings.html
]
...
...
Vagrantfile
View file @
75245c29
# -*- mode: ruby -*-
# -*- mode: ruby -*-
# vi: set ft=ruby :
# vi: set ft=ruby :
DISKS
=
[
require
'yaml'
{
"name"
=>
"home"
,
"size"
=>
50
,
"port"
=>
1
},
{
"name"
=>
"opt"
,
"size"
=>
15
,
"port"
=>
2
},
{
"name"
=>
"docker"
,
"size"
=>
40
,
"port"
=>
3
},
]
DISKS
=
YAML
.
load_file
(
'disks.yml'
)[
'storage_disks'
]
BOX_NAME
=
"devbox"
BOX_NAME
=
"devbox"
Vagrant
.
configure
(
"2"
)
do
|
config
|
Vagrant
.
configure
(
"2"
)
do
|
config
|
...
@@ -40,7 +30,7 @@ Vagrant.configure("2") do |config|
...
@@ -40,7 +30,7 @@ Vagrant.configure("2") do |config|
vb
.
cpus
=
4
vb
.
cpus
=
4
vb
.
name
=
BOX_NAME
vb
.
name
=
BOX_NAME
vb
.
gui
=
ENV
[
"SHOW_GUI"
]
||=
"fals
e"
vb
.
gui
=
(
ENV
[
"SHOW_GUI"
]
||=
"false"
).
to_s
==
"tru
e"
# https://www.virtualbox.org/manual/ch08.html
# https://www.virtualbox.org/manual/ch08.html
vb
.
customize
[
"modifyvm"
,
:id
,
"--vram"
,
"128"
]
vb
.
customize
[
"modifyvm"
,
:id
,
"--vram"
,
"128"
]
...
...
ansible.cfg
View file @
75245c29
[defaults]
[defaults]
roles_path
=
roles:local_roles
roles_path
=
roles:local_roles
disks.yml
0 → 100644
View file @
75245c29
---
storage_disks
:
-
name
:
"
home"
size
:
50
port
:
1
dev
:
"
/dev/sda"
mount
:
"
/home"
-
name
:
opt
size
:
15
port
:
2
dev
:
"
/dev/sdb"
mount
:
"
/opt"
-
name
:
docker
size
:
40
port
:
3
dev
:
"
/dev/sdc"
mount
:
"
/var/lib/docker"
-
name
:
root
size
:
40
port
:
3
dev
:
"
/dev/sdc"
mount
:
"
/"
playbook.yml
View file @
75245c29
...
@@ -10,8 +10,10 @@
...
@@ -10,8 +10,10 @@
apt
:
apt
:
update_cache
:
yes
update_cache
:
yes
cache_valid_time
:
86400
# one day
cache_valid_time
:
86400
# one day
-
import_tasks
:
tasks/partitioning.yml
tags
:
partition
roles
:
roles
:
-
{
role
:
"
geerlingguy.docker"
,
docker_users
:
[
"
vagrant"
],
tags
:
"
docker"
}
-
{
role
:
"
geerlingguy.docker"
,
docker_users
:
[
"
vagrant"
],
tags
:
[
"
docker"
]
}
-
{
role
:
'
jetbrains_installer'
,
tags
:
[
'
jetbrains'
]}
-
{
role
:
'
jetbrains_installer'
,
tags
:
[
'
jetbrains'
]}
-
{
role
:
'
webofmars.xfce4-desktop'
,
tags
:
[
'
desktop'
]}
-
{
role
:
'
webofmars.xfce4-desktop'
,
tags
:
[
'
desktop'
]}
-
{
role
:
'
base'
,
tags
:
[
'
base'
]}
-
{
role
:
'
base'
,
tags
:
[
'
base'
]}
...
...
tasks/partitioning.yml
0 → 100644
View file @
75245c29
-
include_vars
:
disks.yml
-
debug
:
msg="{{ storage_disks }}"
-
debug
:
msg="{{ ansible_mounts }}"
-
debug
:
msg="{{ ansible_mounts | selectattr('mount', 'match', '^' + disk['mount'] + '$') | list }}"
loop
:
"
{{
storage_disks
}}"
loop_control
:
loop_var
:
disk
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