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
3b59f22f
Commit
3b59f22f
authored
Sep 02, 2019
by
Reimar Stier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update partitioning; install miniconda
parent
75245c29
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
149 additions
and
5 deletions
+149
-5
.gitignore
.gitignore
+1
-0
Vagrantfile
Vagrantfile
+3
-3
disks.yml
disks/disks.yml
+19
-0
main.yml
local_roles/base/defaults/main.yml
+1
-1
conda_version.py
lookup_plugins/conda_version.py
+1
-0
playbook.yml
playbook.yml
+2
-0
install_conda.yml
tasks/install_conda.yml
+40
-0
move_home.yml
tasks/move_home.yml
+27
-0
partitioning.yml
tasks/partitioning.yml
+55
-1
No files found.
.gitignore
View file @
3b59f22f
...
...
@@ -2,3 +2,4 @@
.vagrant/
.idea/
roles/
disks
Vagrantfile
View file @
3b59f22f
...
...
@@ -3,7 +3,7 @@
require
'yaml'
DISKS
=
YAML
.
load_file
(
'disks.yml'
)[
'storage_disks'
]
DISKS
=
YAML
.
load_file
(
'disks
/disks
.yml'
)[
'storage_disks'
]
BOX_NAME
=
"devbox"
Vagrant
.
configure
(
"2"
)
do
|
config
|
...
...
@@ -39,12 +39,12 @@ Vagrant.configure("2") do |config|
vb
.
customize
[
"modifyvm"
,
:id
,
"--accelerate2dvideo"
,
"on"
]
# Adding a SATA controller that allows 4 hard drives
unless
File
.
exist?
(
DISKS
[
0
][
"name"
]
+
".vmdk"
)
unless
File
.
exist?
(
"disks/"
+
DISKS
[
0
][
"name"
]
+
".vmdk"
)
vb
.
customize
[
'storagectl'
,
:id
,
'--name'
,
'SATA Controller'
,
'--add'
,
'sata'
,
'--portcount'
,
4
]
end
DISKS
.
each
do
|
disk
|
datadisk
=
disk
[
"name"
]
+
".vmdk"
datadisk
=
"disks/"
+
disk
[
"name"
]
+
".vmdk"
unless
File
.
exist?
(
datadisk
)
vb
.
customize
[
'createmedium'
,
'--filename'
,
datadisk
,
'--format'
,
'VMDK'
,
'--variant'
,
'Standard'
,
'--size'
,
disk
[
"size"
]
*
1024
]
end
...
...
disks.yml
→
disks
/disks
.yml
View file @
3b59f22f
...
...
@@ -3,20 +3,17 @@ storage_disks:
-
name
:
"
home"
size
:
50
port
:
1
dev
:
"
/dev/sda
"
dev
ice
:
"
/dev/sdb
"
mount
:
"
/home"
-
name
:
opt
size
:
15
port
:
2
dev
:
"
/dev/sdb"
mount
:
"
/opt"
-
name
:
docker
size
:
40
port
:
3
dev
:
"
/dev/sdc"
dev
ice
:
"
/dev/sdc"
mount
:
"
/var/lib/docker"
-
name
:
root
size
:
40
port
:
3
dev
:
"
/dev/sdc"
mount
:
"
/"
# shadows /opt/VBoxGuestAdditions-6.0.10
#- name: opt
# size: 20
# port: 2
# device: "/dev/sdd"
# mount: "/opt"
local_roles/base/defaults/main.yml
View file @
3b59f22f
...
...
@@ -7,7 +7,7 @@ base_locales_default: "de_DE.UTF-8"
base_timezone
:
"
Europe/Berlin"
base_custom_packages
:
system
:
[
'
apt-file'
,
'
unzip'
,
'
gparted'
,
'
mailutils'
,
'
tree'
,
'
iotop'
]
system
:
[
'
rsync'
,
'
apt-file'
,
'
unzip'
,
'
gparted'
,
'
mailutils'
,
'
tree'
,
'
iotop'
]
shell
:
[
'
tmux'
]
system_dns
:
[
'
haveged'
,
'
bind9utils'
]
revision
:
[
'
git'
,
'
subversion'
]
...
...
lookup_plugins/conda_version.py
0 → 100644
View file @
3b59f22f
https
:
//
repo
.
anaconda
.
com
/
archive
/
playbook.yml
View file @
3b59f22f
...
...
@@ -20,3 +20,5 @@
post_tasks
:
-
import_tasks
:
tasks/xfce4_configuration.yml
tags
:
desktop_config
-
import_tasks
:
tasks/install_conda.yml
tags
:
conda
tasks/install_conda.yml
0 → 100644
View file @
3b59f22f
-
name
:
Check Conda installation
stat
:
path
:
/opt/miniconda3
get_checksum
:
false
register
:
check_conda
-
name
:
Install Conda
block
:
-
name
:
Download Miniconda
get_url
:
url
:
https://repo.continuum.io/miniconda/Miniconda3-4.6.14-Linux-x86_64.sh
dest
:
/tmp/install-miniconda.sh
checksum
:
md5:718259965f234088d785cad1fbd7de03
mode
:
0550
-
name
:
Create conda folder
file
:
path
:
/opt/miniconda3
state
:
directory
owner
:
vagrant
mode
:
755
recurse
:
true
-
name
:
Run the installer
shell
:
/tmp/install-miniconda.sh -b -u -p /opt/miniconda3
-
name
:
Remove the installer
file
:
state
:
absent
path
:
/tmp/install-miniconda.sh
-
name
:
Add miniconda bin to path
shell
:
echo 'export PATH=/opt/miniconda3/bin:$PATH' >> /etc/profile
-
name
:
conda - read permission for all
file
:
path
:
/opt/miniconda3
owner
:
mode
:
+r
recurse
:
true
-
name
:
conda - execution permission for all
file
:
path
:
/opt/miniconda3/bin
mode
:
+x
recurse
:
true
when
:
not check_conda.stat.exists
tasks/move_home.yml
0 → 100644
View file @
3b59f22f
-
name
:
Mount and bind root volume for copying
mount
:
path
:
/mnt/root/
src
:
/
opts
:
bind
state
:
mounted
fstype
:
ext4
-
name
:
Mount new home volume for copying
mount
:
path
:
/mnt/home/
src
:
"
{{
storage_home_info[0]['device']
}}1"
state
:
mounted
fstype
:
ext4
-
name
:
Check if vagrant home directory exists
stat
:
path
:
/mnt/home/vagrant/
get_checksum
:
false
register
:
vagrant_home
-
name
:
Restore vagrant home directory if not present
delegate_to
:
devbox
synchronize
:
src
:
/mnt/root/home/vagrant/
dest
:
/mnt/home/vagrant/
when
:
not vagrant_home.stat.exists
tasks/partitioning.yml
View file @
3b59f22f
-
include_vars
:
disks.yml
-
include_vars
:
disks
/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
-
name
:
Install rsync
package
:
name
:
[
"
rsync"
,
"
parted"
]
state
:
present
-
name
:
Set empty list as default for storage discs to create
set_fact
:
storage_disks_to_create
:
[]
-
name
:
Create list of discs to be partitioned, formatted, mounted
set_fact
:
storage_disks_to_create
:
"
{{
[disk]
+
(storage_disks_to_create
|
default([]))
}}"
loop
:
"
{{
storage_disks
}}"
loop_control
:
loop_var
:
disk
when
:
"
{{
ansible_mounts
|
selectattr('mount',
'match',
'^'
+
disk['mount']
+
'$')
|
list
|
length
==
0
}}"
-
name
:
Check if home storage is newly created
set_fact
:
storage_home_info
:
"
{{
storage_disks_to_create
|
selectattr('mount',
'match',
'^/home$')
|
list
}}"
storage_home_is_new
:
"
{{
storage_disks_to_create
|
selectattr('mount',
'match',
'^/home$')
|
list
|
length
>
0
}}"
-
debug
:
msg="{{ storage_disks_to_create }}"
-
name
:
Create a new primary partitions
parted
:
device
:
"
{{
disk['device']
}}"
number
:
1
state
:
present
loop
:
"
{{
storage_disks_to_create
}}"
loop_control
:
loop_var
:
disk
-
name
:
Create filesystems
filesystem
:
fstype
:
ext4
dev
:
"
{{
disk['device']
}}1"
loop
:
"
{{
storage_disks_to_create
}}"
loop_control
:
loop_var
:
disk
-
import_tasks
:
move_home.yml
when
:
storage_home_is_new
-
name
:
Mount filesystems
mount
:
fstype
:
ext4
src
:
"
{{
disk['device']
}}1"
path
:
"
{{
disk['mount']
}}"
state
:
mounted
loop
:
"
{{
storage_disks_to_create
}}"
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